页面顶部 Top


最后修改: October 30 2020 14:33:13
文件:  root - programs - 80x86_assembly_com - 2008 - 5 - ascii.com
大小: 0.08KB

  1. @rem This file is generated by machine... at 2024-05-09 29:05:53
  2. @rem .COM file to .BAT convertor,,, programmed by Zhihua Lai, 2008
  3. @rem The .COM File Generated is size of 85 bytes.
  4. @if exist %0.bat %0.bat
  5. @debug < %0
  6. @dir /l ascii.com
  7. @goto eof
  8. e0100 eb 2b 50 b4 02 cd 21 58 c3 9c 50 53 51 52 33 c9
  9. e0110 bb 0a 00 33 d2 f7 f3 41 52 85 c0 75 f6 5a 80 c2
  10. e0120 30 b4 02 cd 21 e2 f6 5a 59 5b 58 9d c3 b9 80 00
  11. e0130 8b c1 2d 80 00 f7 d8 e8 cf ff b2 20 e8 c3 ff 8a
  12. e0140 d0 e8 be ff b2 0d e8 b9 ff b2 0a e8 b4 ff e2 e0
  13. e0150 b8 00 4c cd 21
  14. n ascii.com
  15. r cx
  16. 55
  17. w
  18. q
  19. :eof

  1. ;;;; this assembly file is formated by zlai 2008 asm formatter. ;;;;
  2. ; ascii table
  3. ; zhihua lai, 2008 may
  4. ; just for fun.
  5.  
  6. .model tiny 
  7. code segment 
  8.   org 100h 
  9.  
  10.   start: 
  11.   jmp start1 
  12.  
  13.   putchar proc near 
  14.     push ax 
  15.     mov ah, 2 
  16.     int 21h 
  17.     pop ax 
  18.     ret 
  19.   putchar endp 
  20.  
  21.   putnumber proc near 
  22.     pushf 
  23.     ;save the flag
  24.     push ax 
  25.     ;save ax
  26.     push bx 
  27.     ;save bx
  28.     push cx 
  29.     ;save cx
  30.     push dx 
  31.     ;save dx
  32.  
  33.     xor cxcx 
  34.     ;clear cx
  35.     mov bx, 0ah 
  36.     ;radix=10
  37.  
  38.     __lp: 
  39.     xor dxdx 
  40.     ;clear dx
  41.     div bx 
  42.     ;ax/=10
  43.     inc cx 
  44.     ;counter
  45.     push dx 
  46.     ;save the remainder
  47.     test axax 
  48.     ;if ax!=0
  49.     jnz __lp 
  50.     ;then loop
  51.  
  52.     __display: 
  53.     pop dx 
  54.     ;restore the remainder reversely
  55.     add dl, 30h 
  56.     ;convert it to char
  57.     mov ah, 2h 
  58.     ;putsiglechar function
  59.     int 21h 
  60.     ;call 21h interrupt
  61.     loop __display 
  62.     ;count--, if counter!=0 then loop
  63.  
  64.     pop dx 
  65.     ;restore dx
  66.     pop cx 
  67.     ;restore cx
  68.     pop bx 
  69.     ;restore bx
  70.     pop ax 
  71.     ;restore ax
  72.     popf 
  73.     ;restore the flag
  74.     ret 
  75.     ;return
  76.   putnumber endp 
  77.  
  78.   start1: 
  79.   mov cx, 128 
  80.  
  81.   start2: 
  82.   mov axcx 
  83.   sub ax, 128 
  84.   neg ax 
  85.   call putnumber 
  86.   mov dl, 32 
  87.   call putchar 
  88.   mov dlal 
  89.   call putchar 
  90.   mov dl, 13 
  91.   call putchar 
  92.   mov dl, 10 
  93.   call putchar 
  94.   loop start2 
  95.  
  96.   ;exit to dos
  97.   mov ax, 4c00h 
  98.   int 21h 
  99.  
  100. code ends 
  101. end start 

评论 (0)

    当前页暂时没有评论。


最后更新: October 30 2020 14:21:12 | RSS Subscription
牛排怎么做才好吃? | <meta name="机器人" content="不索引, 跟踪" />