home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug035.ark
/
OBJECT.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-04-29
|
2KB
|
72 lines
; 6 SEPT 79 - FIXING OBJR,OBJW TO AVOID ACCESS TO OBJECTS
; BEYOND 16. COMBINING SOURCE FILE WITH INOUT.ASM.
;
;
ORG 5125H
* THESE TWO ROUTINES (OBJR & OBJW) READ AND WRITE GIVEN BYTES
* OF A GIVEN OBJECT. THE OBJECT TABLE IS LOCATED AT 1000 HEX AND IS DESCRIB
* IN DETAIL IN THE FELIX 8080 IMPLEMENTATION MANUAL
*
HIBITZ EQU 010H
* OBJR RETURNS IN A THE E-TH (0 <= E <= 256) OF THE D-TH (0<= D <= 15) OBJEC
OBJR: PUSH D
MOV A,D
ANI 0FH ;SELECT OBJECT 0 - 15
ORI HIBITZ ;AND GET RIGHT PART OF WORLD
MOV D,A ; TO THE PROPER BYTE OF THE OBJECT IN QUESTION
LDAX D ; READ THE BYTE AND RETURN WITH IT
POP D
RET
* OBJW PUTS THE CONTENTS OF A INTO THE E-TH (0 <=E <= 256)
* BYTE OF THE D-TH (0 <= D <= 15) OBJECT
OBJW: PUSH D
PUSH PSW ; SAVE THE CONTENTS OF A FOR LATER
MOV A,D
ANI 0FH ;SELECT OBJECT 0 - 15
ORI HIBITZ ;AND GET RIGHT AREA.
MOV D,A ; TO THE PROPER BYTE OF THE OBJECT IN QUESTION
POP PSW ; RETRIEVE THE BYTE WE WANT WRITTEN
STAX D ; AND WRITE IT
POP D
RET
ORG 513BH
CR EQU 0DH
LF EQU 0AH
* THIS ROUTINE OUTPUTS A CARRIAGE RETURN AND LINE-FEED TO
* THE TERMINAL BY LOADING THE CHARACTERS INTO A AND
* USING THE ROUTINE "CO" DESCRIBED BELOW.
CRLF: PUSH PSW
MVI A,CR
CALL CO
MVI A,LF
CALL CO
POP PSW
RET
BIOS EQU 05H
* THIS ROUTINE GETS A CHARACTER FROM THE TELETYPE USING
* THE BUILT-IN CPM ROUTINE AND RETURNS IT IN THE ACCUMULATOR.
* THE CHARACTER IS ECHOED.
CI: PUSH B ! PUSH D ! PUSH H
MVI C,1
CALL BIOS
POP H ! POP D ! POP B
RET
* THIS ROUTINE TAKES A CHARACTER FROM THE ACCUMULATOR
* AND SENDS IT OUT TO THE TELETYPE USING THE BUILT-IN
* CPM ROUTINE. THE CPM ROUTINE DESTROYS A, SO WE SAVE IT.
CO: PUSH PSW !PUSH B ! PUSH D ! PUSH H
MVI C,2
MOV E,A
CALL BIOS
POP H !POP D ! POP B ! POP PSW
RET
* THIS ROUTINE PRINTS A STRING OF CHARACTERS POINTED TO BY
* HL (TO THE TTY, NATURALLY) USING THE BUILT-IN CPM ROUTINE.
* THE END OF THE STRING IS INDICATED BY THE CHARACTER "$".
PRINT: PUSH B ! PUSH D ! PUSH H
XCHG
MVI C,9
CALL BIOS
POP H ! POP D ! POP B
RET