Terry Yager
Veteran Member
Anybody here speak/remember any 8080 assembly language? I'm having some problems with buggy code and could use a little help.
--T
--T
Terry Yager said:Gee, it's been awhile, but as I recall, I wasn't using any stack other than the Z80's own stack space. The code came from the book Soul of CP/M, and is just one of several serious errors I found in the book. Even with it's faults, I did learn more A/L programming from that book than I have from any other source, so it's still a keeper.
--T
Know the book.
Personally, the best book for CP/M programming is The Programmers CP/M Handbook by Andy Johnson-laird (Osborne/McGraw-hill). There
are other 8080/z80 programming books as well by Osborne and The Blacksburg Group.
Allison
Terry Yager said:OK, for starters, can you tell me what's wrong with this subroutine? It's s'posed to read the (ASCII) character in the A register and print it out to the screen, using the CP/M system call 2h "Console out", after which it should return control to the calling program, but instead of returning to CP/M, it just gets lost and hangs the machine.
;
bdos equ 5h
conout equ 2h
;
;subroutine to print character in a-reg out on screen
;
pchar push h ;save hl (conout uses it)
mov e,a ;print hex digit
mvi c,conout
call bdos
pop h ;get hl back
ret
;
end
;
I have used DDT's "T"(race) command to single step thru this prog and the point where it loses control is where it calls the subroutine "pchar".
Is this snippet enough to work with, or do you need the entire program?
--T
(Sorry if the listing looks funny, your editor doesn't seem to recognize tabs or spaces.)