Autor Thema: Wie übergebe ich einen Text / String-Parameter an CP/M?  (Gelesen 1249 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Online TFM

  • Administrator
  • CPC 6128+
  • *****
  • Beiträge: 4.021
  • Likes gesamt: 148
  • Karma: +57/-0
  • Geschlecht: Männlich
  • FutureSoft und CPC - Ein starkes Team!
    • FutureOS
Wie übergebe ich einen Text / String-Parameter an CP/M?
« am: 14. Januar 2021, 18:20:49 »
Also hier ein Beispiel... Ich tippe...

A> SPEAK Dies ist ein Beispieltext

Wenn ich jetzt die Applikation SPEAK.COM bin, wie kann ich dann den Text im RAM finden?
TFM of FutureSoft
http://www.FutureOS.de --> Das Betriebssystem FutureOS (Update: 22.02.2022)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> RSX ROM für LambdaSpeak (Update: 26.12.2021)

Offline LambdaMikel

Re: Wie übergebe ich einen Text / String-Parameter an CP/M?
« Antwort #1 am: 15. Januar 2021, 21:06:03 »
Vielleicht hilft das hier; s. CP/M 8080 assembly ("CP/M includes some very rudimentary argument parsing: it assumes that the first two space-separated arguments are filenames. Apart from that you can get the raw command line, except that all lowercase letters are made uppercase.

If you need any further parsing, the program needs to do that by itself, which led to many people not bothering.")

https://rosettacode.org/wiki/Command-line_arguments

Online TFM

  • Administrator
  • CPC 6128+
  • *****
  • Beiträge: 4.021
  • Likes gesamt: 148
  • Karma: +57/-0
  • Geschlecht: Männlich
  • FutureSoft und CPC - Ein starkes Team!
    • FutureOS
Re: Wie übergebe ich einen Text / String-Parameter an CP/M?
« Antwort #2 am: 17. Januar 2021, 16:27:04 »
Danke, ich sehe es mir an, könnte sein was ich suche.  :smiley027:
TFM of FutureSoft
http://www.FutureOS.de --> Das Betriebssystem FutureOS (Update: 22.02.2022)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> RSX ROM für LambdaSpeak (Update: 26.12.2021)

Online TFM

  • Administrator
  • CPC 6128+
  • *****
  • Beiträge: 4.021
  • Likes gesamt: 148
  • Karma: +57/-0
  • Geschlecht: Männlich
  • FutureSoft und CPC - Ein starkes Team!
    • FutureOS
Re: Wie übergebe ich einen Text / String-Parameter an CP/M?
« Antwort #3 am: 27. Dezember 2021, 18:20:31 »
Und so sieht dann der Source Code aus.... für SP.COM


NOLIST        ;SP.MAX
ORG   &0100   ;2021.01.19
WRITE"SP.COM" ;Zeilen 48


JR START
;
; --- >>> Version und Konfiguration <<< ---
;
 DB &18,&0D,"   ",&0A,&0D
 DB &0D
 DB "SP.COM - speaks and prints command line",&0A,&0D
 DB "(c)2021 LambdaMikel and TFM of FutureSoft",&0A,&0D
 DB "Powered by FutureOS knowhow!",&0A,&0D
 DB &1A
;
; --- >>> String (von Eingabezeile) anzeigen und sprechen <<< ---
;
START LD BC,&FBEE:LD A,&E8:OUT (C),A ;Confirmatins OFF

 LD HL,&0081 ;HL = Zeiger auf Stringanfang

 LD A,&EF:OUT (C),A ;LS auf Epson Modus

 LD A,(&0080) ;A = Laenge des Strings (max. 127 Bytes)

ZSTR AND A,A ;String-Laenge = &00?
     RET Z   ;Dann fertig!

 PUSH AF:PUSH BC:PUSH HL ; Save A, BC and HL registers on the stack

 LD  E,(HL) ;E = naechstes Zeichen aus String
 OUT (C),E  ;Zeichen an LS senden

 LD   C,&02 ;CP/M Kommando Zeichen darstellen
 CALL &0005 ;BDOS aufrufen

 POP HL:POP BC:POP AF ; Restore A and HL registers

 INC HL ;Increment string pointer
 DEC A  ;Decrement character counter

 JR NZ,ZSTR ;n. Zeichen

 LD A,&0D:OUT (C),A ;CR senden, String sprechen

 RET


Nebenbei: Die fertige SP.COM Applikation ist auf der LS Disk 2 drauf.
TFM of FutureSoft
http://www.FutureOS.de --> Das Betriebssystem FutureOS (Update: 22.02.2022)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> RSX ROM für LambdaSpeak (Update: 26.12.2021)