hi .
i am trying to make a write records routine to output last in first out.
I have a table initialized to (20 records of 21 bytes each )
of *.
I can output the records lastin first out BUT i am also outputing all the initialized aread of the table -all the *.
any input would be much appreciated.
Thanks
; Write All Records in TABLE on the users Screen
; [ LAST In, First Out (FIFO) sequence ]
Write_Recs:
Mov DX,OffSet Table ;Set DX to point to Table
Add DX,420D ; point to end of possible Table
Mov CX,20D ;Set Loop counter to MAX #Recs input
a: Sub DX, 21D ; go to beginning of LAST line
Cmp DX, 42D ; this doesn't help!!
JE a
Mov AH,9 ;Set AH for DOS String Output
P_Loop:
Int 21H ;Write the record to the screen
Sub DX,21D ;Set DX to point to next record
Push DX ;save DX on the stack
Mov DX, OffSet Cr_Lf ;set up write
Mov AH, 9 ;DOS write <CR><LF> to screen
Int 21H ;
Pop DX ;restore DX (from the stack)
Loop P_Loop ;go write another one until done...
; Output of Table to Screen complete...
Mov AX,4C00H ;setup for return to DOS
Int 21H
Ret
i am trying to make a write records routine to output last in first out.
I have a table initialized to (20 records of 21 bytes each )
of *.
I can output the records lastin first out BUT i am also outputing all the initialized aread of the table -all the *.
any input would be much appreciated.
Thanks
; Write All Records in TABLE on the users Screen
; [ LAST In, First Out (FIFO) sequence ]
Write_Recs:
Mov DX,OffSet Table ;Set DX to point to Table
Add DX,420D ; point to end of possible Table
Mov CX,20D ;Set Loop counter to MAX #Recs input
a: Sub DX, 21D ; go to beginning of LAST line
Cmp DX, 42D ; this doesn't help!!
JE a
Mov AH,9 ;Set AH for DOS String Output
P_Loop:
Int 21H ;Write the record to the screen
Sub DX,21D ;Set DX to point to next record
Push DX ;save DX on the stack
Mov DX, OffSet Cr_Lf ;set up write
Mov AH, 9 ;DOS write <CR><LF> to screen
Int 21H ;
Pop DX ;restore DX (from the stack)
Loop P_Loop ;go write another one until done...
; Output of Table to Screen complete...
Mov AX,4C00H ;setup for return to DOS
Int 21H
Ret