Untitled

 avatar
unknown
plain_text
4 years ago
989 B
7
Indexable
; Title: Data Types
; Description: Simple code to understand datatypes and
representation in IA-32
; Author: Shashank "SLAER" Gosavi
global _start
section .text
_start:
; Graceful Exit code
mov eax, 1
mov ebx, 0
int 80h
section .data
var1: db 0x55 ; Just byte 0x55
var2: db 0x55, 0x56, 0x57 ; three bytes in succession
var3: db 'a', 0x55 ; character constant
var4: db 'hi', 14, 15, '$' ; string constant
var5: dw 0x1234 ; 0x34 0x12 due to Little
Endianness
var6: dw 'a' ; 0x61 0x00 (just number)
var7: dw 'ab' ; Character constant
var8: dw 'abc' ; 0x61 0x62 0x63 0x00 (string)
var9: dd 0x12345678 ; 0x78 0x56 0x34 0x12
var10: dd 1.234567e20 ; floating-point constant
var11: dq 0x123456789abcdef0 ; eight-byte constant
var12: dq 1.234567e20 ; double-precision float
var13: dt 1.234567e20 ; extended-precision float 
Thực hành CTMT&HN-2019 Khoa CNTT – ĐHSPKT TP.HCM Trang - 10
section .bss
buffer: resb 64 ; reserve 64 byte
wordvar: resw 1 ; reserve a word
Editor is loading...