惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
Jina AI
Jina AI
博客园_首页
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
Forbes - Security
Forbes - Security
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
N
News | PayPal Newsroom
S
Security Archives - TechRepublic
量子位
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
C
Cisco Blogs
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
Scott Helme
Scott Helme
S
Securelist
Security Latest
Security Latest
爱范儿
爱范儿
TaoSecurity Blog
TaoSecurity Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
L
LINUX DO - 最新话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
美团技术团队
Know Your Adversary
Know Your Adversary
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
月光博客
月光博客
T
Tailwind CSS Blog
Cloudbric
Cloudbric
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
D
DataBreaches.Net
博客园 - 【当耐特】
有赞技术团队
有赞技术团队

博客园 - IT 笔记

Subversion Revert File will not be shown in Modification Surprise vb.net WinForm don't require instance to access the instance value Properties.Settings show error 'System.Windows.Forms.PropertyStore' does not contain a definition for 'Settings' Add Image in MS Report RDLC by using Embedded Image 王爽汇编 Lab 13 Question 1, 用两个程序实现 Spring.NET Installation and setup the first program 王爽汇编语言 实验11 王爽汇编语言 检测点11.2 王爽 汇编语言程序课程设计1 王爽 汇编语言程序设计 实验9 (Assembly Language Study) 王爽 汇编语言程序设计 检测点9.1 第2题 The NTVDM CPU has encountered an illegal instruction. CS:0006 IP:130a .... select files by multiple extension name Access Denied when running Spring.IocQuickStart.MovieFinder using vb.net read unix style text file How to install autotrace in fontforge My first postscript program .net 2 config - IT 笔记 A generic winform skeleton support interactive UI during large job process
王爽 汇编语言程序设计实验10,题三,数值转换。(Assembly experiment Convert HEX to Decimal and Show on screen )
IT 笔记 · 2011-09-17 · via 博客园 - IT 笔记

  1 assume cs:codesg, ds:data 
  2 data segment
  3     ;00 is filler a
  4     ;317ah is 12666 hex value
  5     ;0000h is high bits. if the number is big and hex value is f317ah, then here 0000h will be 0000fh
  6     ;000Ah is hex value of 10.
  7     ;rest of 0008h are just filler to make the debug view eaiser
  8     dw 00,317ah,0000h,000Ah,0008h,0008h,0008h,0008h 
  9     
 10     ;here will hold decimal text
 11     db '                '
 12 data ends 
 13 codesg segment
 14 start:   
 15     mov ax, data ;set data address
 16     mov ds, ax 
 17     mov bx, 16   ;set decial text text offset in bx, because declare 8 words, so here is 16
 18     mov cx, 0
 19     push cx      ;push a zero in bottom of stack, and it will be terminator of text
 20     divNext: 
 21         CALL DivDW      ; return remainder in [0] position, and quotient is still in [2] for next divide
 22         mov cx, ds:[0]  ; set remainder in cx
 23         add cx, 30h     ; add decimal ascii
 24         push cx         ; save the decimal in stack
 25         
 26         mov ax, ds:[2]  ; using bit OR to merge Divident H to Divident Low
 27         OR ax, ds:[4]    ; Divident H is ds:[4], Divident L is ds:[2]
 28         MOV cx, ax        ; Then check whether ds:[2] is 0 or not
 29         jcxz EXIT_DN    ; if quotient is 0, exit divNext
 30         
 31     jmp divNext         ; continue get next decimal value
 32     
 33     EXIT_DN:            ; When run to here, the stack contain all decimal ascii  
 34         pop cx            ; get decimal ascii from stack
 35         jcxz Exit_DT    ; if ascii value in stack is 0, then exit. 
 36                         ; This zero is the terminator pushed at line 19 
 37         mov ds:[bx+16], cx  ;move the ascii to data section declared at line 11
 38         add bx,1
 39     jmp EXIT_DN
 40     
 41     Exit_DT:
 42     Call  Show_Str      ; Show_Str show text from memory declared at line 11
 43      
 44     mov ax, 4c00h
 45     int 21h
 46     
 47     ;********************************************************************
 48     ;                        CONVERT to DECIMAL    
 49     ;divisor 除数 
 50     ;divisor 除数 can 8 bits or 16 bits and can be in register or memory
 51     ;dividend 被除数 , have to be AX or DX and AX, 
 52     ;divisor is 8 bits, then dividend is in AX.              | the result is AL = quotient 商, AH = remainder 余 
 53     ;divisor is 16 bits, then dividend is in DX(H) and AX(L) | the result is AX = quotient 商, DX = remainder 余  
 54     
 55     divDW:  ;chapter: 8.7  Page 157 
 56     pop BP    
 57     push bx     
 58         MOV BX, ds:[2;4240 Divident(L)             
 59         MOV AX ,ds:[4; 000f   Divident(H)
 60         MOV CX ,ds:[6; 000A     Divisor
 61         MOV DX, 0        
 62         DIV CX     ; (DX(0) + AX(000f)) / CX
 63         mov ds:[4], ax
 64         MOV AX, BX ; move Divident (L) in AX
 65         DIV CX     ; (DX(0005) + AX (4240)) / CX
 66         mov ds:[2], ax 
 67         mov ds:[0], dx
 68     pop bx
 69     PUSH BP    ; SET IP back to stack 
 70     ret
 71     
 72     ;***********************************************************
 73     ;******                   Show Text
 74     show_str:
 75     pop bp 
 76         mov ax, 0b86eh
 77         mov ss, ax      ;row
 78         mov si, 40      ;Column
 79         mov bx, 0       ;String stard postion
 80         mov ah, 00000010B ;Font 
 81         push ss
 82         push si
 83         push ds
 84         push bx 
 85     main:             
 86         mov cl, ds:[bx+16]   ; ds:[bx] is the character 
 87         mov al, cl  
 88         mov ch, 0
 89         jcxz EXIT_SS
 90         mov ss:[si], ax ; this  ss:[si+bx] is character position    
 91         inc bx 
 92         add si, 2
 93     jmp short main
 94     
 95     EXIT_SS:        
 96         pop bx            
 97         pop ds            
 98         pop si
 99         pop ss
100     push bp
101     ret 
102 codesg ends