; testing div10

TITLE hw2 testing div10
.model small
.stack 100h
.data
p       db 40 dup (0)
q       db 40 dup (0)
.code

;; input macros
include mac.asm

main proc
  mov ax,@data
  mov ds,ax
; set up P
  lea si,p
  mov p,1
  mov [si+39], byte ptr 123
  lea di,q
;		FIRST CALL 
  call div10
;
  disp_str 'this is the original byte: 123'
  new_line
  disp_str 'this is the remainder on dividing by 10:' 
  new_line
  mov bl,ah
  add bl,030h
  putChar bl
  new_line
;               CALL AGAIN, second time (exchange role of P and Q)
  lea si,q
  lea di,p
  call div10
;               SEE THE RESULTS
  disp_str 'this is the next remainder on dividing by 10:'
  new_line
  mov bl,ah
  add bl,030h
  putChar bl
  new_line
;               CALL AGAIN, third time
  lea si,p
  lea di,q
  call div10
;               SEE THE RESULTS
  disp_str 'this the third remainder on division by 10:'
  new_line
  mov bl,ah
  add bl,030h
  putChar bl
  new_line
;               DONE
  disp_str 'That is all folks'
  dos_rtn 0
main  endp
;
; include procedures
include div10.asm

  end main
  

