Skip to content

Commit

Permalink
Add checkpoint solutions (9.2, 13.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhyy committed May 23, 2021
1 parent f4b6331 commit f9ce701
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Checkpoints/chk13_1.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
assume cs:code
data segment
db 'Light and Wings',0
data ends

code segment
start: call setjpn
mov ax,data
mov ds,ax
mov si,0
mov ax,0b800h
mov es,ax
mov di,12*160
s: cmp byte ptr [si],0
je ok
mov al,[si]
mov es:[di],al
inc si
add di,2
mov bx,offset s-offset ok
int 7ch
ok: mov ax,4c00h
int 21h
; Set up jpn
setjpn:mov ax,cs
mov ds,ax
mov si,offset jpn
mov ax,0
mov es,ax
mov di,200h
mov cx,offset jpnend-offset jpn
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:[7ch*4],200h
mov word ptr es:[7ch*4+2],0
ret
jpn:push bp
mov bp,sp
add [bp+2],bx
pop bp
iret
jpnend:nop
code ends
end start
19 changes: 19 additions & 0 deletions Checkpoints/chk9_2.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
assume cs:code
data segment
dd 1,2,3,4
data ends

code segment
start: mov ax,2000H
mov ds,ax
mov bx,0
s: mov cl,0
mov ch,[bx]
jcxz ok
inc bx
jmp short s
ok: mov dx,bx
mov ax,4c00h
int 21h
code ends
end start

0 comments on commit f9ce701

Please sign in to comment.