页面顶部 Top


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

  1. @rem This file is generated by machine... at 2024-05-09 02:05:05
  2. @rem .COM file to .BAT convertor,,, programmed by Zhihua Lai, 2008
  3. @rem The .COM File Generated is size of 279 bytes.
  4. @if exist %0.bat %0.bat
  5. @debug < %0
  6. @dir /l chr.com
  7. @goto eof
  8. e0100 e9 c6 00 00 00 00 00 0a 41 53 43 49 49 20 4c 6f
  9. e0110 6f 6b 75 70 20 55 74 69 6c 69 74 79 3a 20 4e 6f
  10. e0120 20 65 6e 6f 75 67 68 20 70 61 72 61 6d 65 74 65
  11. e0130 72 73 2e 0d 0a 24 50 61 72 61 6d 65 74 65 72 3a
  12. e0140 20 41 20 64 65 63 69 6d 61 6c 20 6e 75 6d 62 65
  13. e0150 72 20 66 72 6f 6d 20 30 20 7e 20 32 35 35 2e 0d
  14. e0160 0a 24 50 72 6f 67 72 61 6d 6d 65 64 20 62 79 20
  15. e0170 5a 68 69 68 75 61 20 4c 61 69 2c 20 32 30 30 38
  16. e0180 20 41 70 72 69 6c 2c 20 6a 75 73 74 20 66 6f 72
  17. e0190 20 66 75 6e 2e 0d 0a 24 42 61 64 20 41 72 67 75
  18. e01a0 6d 65 6e 74 21 0d 0a 24 b4 09 8d 16 98 01 cd 21
  19. e01b0 b4 09 8d 16 08 01 cd 21 8d 16 36 01 cd 21 8d 16
  20. e01c0 62 01 cd 21 b8 01 4c cd 21 be 80 00 32 ed 8a 0c
  21. e01d0 e3 de 46 fe c9 46 8a 04 3c 20 74 22 3c 30 72 c8
  22. e01e0 3c 39 77 c4 2c 30 32 e4 2e a3 05 01 2e a1 03 01
  23. e01f0 2e f6 26 07 01 2e 03 06 05 01 2e a3 03 01 e2 d5
  24. e0200 2e 81 3e 03 01 ff 00 77 9f b4 02 2e 8a 16 03 01
  25. e0210 cd 21 b8 00 4c cd 21
  26. n chr.com
  27. r cx
  28. 117
  29. w
  30. q
  31. :eof

  1. ;;;; this assembly file is formated by zlai 2008 asm formatter. ;;;;
  2. ; ascii 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.   num dw 0 
  14.   new dw 0 
  15.   ten db 0ah 
  16.  
  17.   msg1 db "ascii lookup utility: no enough parameters.", 13, 10, "$" 
  18.   msg2 db "parameter: a decimal number from 0 ~ 255.", 13, 10, "$" 
  19.   msg3 db "programmed by zhihua lai, 2008 april, just for fun.", 13, 10, "$" 
  20.   msg4 db "bad argument!", 13, 10, "$" 
  21.  
  22.   badarg: 
  23.   mov ah, 09h 
  24.   lea dx, msg4 
  25.   int 21h 
  26.  
  27.   noarg: 
  28.   mov ah, 09h 
  29.   lea dx, msg1 
  30.   int 21h 
  31.   lea dx, msg2 
  32.   int 21h 
  33.   lea dx, msg3 
  34.   int 21h 
  35.   mov ax, 4c01h 
  36.   int 21h 
  37.  
  38.   start1: 
  39.   mov si, 80h 
  40.   xor chch 
  41.   mov cl, [si
  42.   jcxz noarg 
  43.   inc si 
  44.   dec cl 
  45.  
  46.   chk: 
  47.   inc si 
  48.   mov al, [si
  49.   cmp al, ' ' 
  50.   jz ok 
  51.   cmp al, '0' 
  52.   jb badarg 
  53.   cmp al, '9' 
  54.   ja badarg 
  55.   sub al, '0' 
  56.   xor ahah 
  57.   mov new, ax 
  58.   mov ax, num 
  59.   mul ten 
  60.   add ax, new 
  61.   mov num, ax 
  62.  
  63.   ok: 
  64.   loop chk 
  65.   cmp num, 0ffh 
  66.   ja badarg 
  67.   mov ah, 2 
  68.   mov dlbyte ptr [num] 
  69.   int 21h 
  70.   mov ax, 4c00h 
  71.   int 21h 
  72.  
  73. code ends 
  74. end start 

评论 (0)

    当前页暂时没有评论。


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