页面顶部 Top


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

  1. @rem This file is generated by machine... at 2024-05-09 01:05:57
  2. @rem .COM file to .BAT convertor,,, programmed by Zhihua Lai, 2008
  3. @rem The .COM File Generated is size of 252 bytes.
  4. @if exist %0.bat %0.bat
  5. @debug < %0
  6. @dir /l ord.com
  7. @goto eof
  8. e0100 e9 c6 00 41 53 43 49 49 20 52 65 76 65 72 73 65
  9. e0110 20 4c 6f 6f 6b 75 70 20 55 74 69 6c 69 74 79 3a
  10. e0120 20 4e 6f 20 65 6e 6f 75 67 68 20 70 61 72 61 6d
  11. e0130 65 74 65 72 73 2e 0d 0a 24 50 61 72 61 6d 65 74
  12. e0140 65 72 3a 20 41 20 53 74 72 69 6e 67 0d 0a 24 50
  13. e0150 72 6f 67 72 61 6d 6d 65 64 20 62 79 20 5a 68 69
  14. e0160 68 75 61 20 4c 61 69 2c 20 32 30 30 38 20 41 70
  15. e0170 72 69 6c 2c 20 6a 75 73 74 20 66 6f 72 20 66 75
  16. e0180 6e 2e 0d 0a 24 50 b4 02 cd 21 58 c3 9c 50 53 51
  17. e0190 52 33 c9 bb 0a 00 33 d2 f7 f3 41 52 85 c0 75 f6
  18. e01a0 5a 80 c2 30 b4 02 cd 21 e2 f6 5a 59 5b 58 9d c3
  19. e01b0 b4 09 8d 16 03 01 cd 21 8d 16 39 01 cd 21 8d 16
  20. e01c0 4f 01 cd 21 b8 01 4c cd 21 be 80 00 32 ed 8a 0c
  21. e01d0 e3 de 46 fe c9 32 e4 46 8a 04 3c 20 74 17 8a d0
  22. e01e0 e8 a2 ff b2 09 e8 9d ff e8 a1 ff b2 0d e8 95 ff
  23. e01f0 b2 0a e8 90 ff e2 e0 b8 00 4c cd 21
  24. n ord.com
  25. r cx
  26. fc
  27. w
  28. q
  29. :eof

  1. ;;;; this assembly file is formated by zlai 2008 asm formatter. ;;;;
  2. ; ascii reverse look up
  3. ; programmed by zhihua lai,
  4. ; 2008 april 16, just for fun
  5.  
  6. .model tiny 
  7. code segment 
  8.   org 100h 
  9.  
  10.   start: 
  11.   jmp start1 
  12.  
  13.   msg1 db "ascii reverse lookup utility: no enough parameters.", 13, 10, "$" 
  14.   msg2 db "parameter: a string", 13, 10, "$" 
  15.   msg3 db "programmed by zhihua lai, 2008 april, just for fun.", 13, 10, "$" 
  16.  
  17.   putchar proc near 
  18.     push ax 
  19.     mov ah, 2h 
  20.     int 21h 
  21.     pop ax 
  22.     ret 
  23.   putchar endp 
  24.  
  25.   putnumber proc near 
  26.     pushf ;save the flag
  27.     push ax ;save ax
  28.     push bx ;save bx
  29.     push cx ;save cx
  30.     push dx ;save dx
  31.  
  32.     xor cx, cx ;clear cx
  33.     mov bx, 0ah ;radix=10
  34.  
  35.     __lp: 
  36.     xor dx, dx ;clear dx
  37.     div bx ;ax/=10
  38.     inc cx ;counter
  39.     push dx ;save the remainder
  40.     test axax ;if ax!=0
  41.     jnz __lp ;then loop
  42.  
  43.     __display: 
  44.     pop dx ;restore the remainder reversely
  45.     add dl, 30h ;convert it to char
  46.     mov ah, 2h ;putsiglechar function
  47.     int 21h ;call 21h interrupt
  48.     loop __display ;count--, if counter!=0 then loop
  49.  
  50.     pop dx ;restore dx
  51.     pop cx ;restore cx
  52.     pop bx ;restore bx
  53.     pop ax ;restore ax
  54.     popf ;restore the flag
  55.     ret ;return
  56.   putnumber endp 
  57.  
  58.   noarg: 
  59.   mov ah, 09h 
  60.   lea dx, msg1 
  61.   int 21h 
  62.   lea dx, msg2 
  63.   int 21h 
  64.   lea dx, msg3 
  65.   int 21h 
  66.   mov ax, 4c01h 
  67.   int 21h 
  68.  
  69.   start1: 
  70.   mov si, 80h 
  71.   xor chch 
  72.   mov cl, [si
  73.   jcxz noarg 
  74.   inc si 
  75.   dec cl 
  76.   xor ahah 
  77.  
  78.   chk: 
  79.   inc si 
  80.   mov al, [si
  81.   cmp al, ' ' 
  82.   jz ok 
  83.   mov dlal 
  84.   call putchar 
  85.   mov dl, 9 
  86.   call putchar 
  87.   call putnumber 
  88.   mov dl, 13 
  89.   call putchar 
  90.   mov dl, 10 
  91.   call putchar 
  92.  
  93.   ok: 
  94.   loop chk 
  95.   mov ax, 4c00h 
  96.   int 21h 
  97.  
  98. code ends 
  99. end start 

评论 (0)

    当前页暂时没有评论。


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