代码如下:
```
; ASCII码表显示程序
; 作者: AI语言助手
section .data
ascii db "ASCII码表", 0
line db "-----------------------", 0
table db "十进制 十六进制 字符", 0
ascii_values db 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
section .text
global _start
_start:
; 输出 ASCII码表 标题
mov eax, 4
mov ebx, 1
mov ecx, ascii
mov edx, 9
int 0x80
; 输出 分割线
mov eax, 4
mov ebx, 1
mov ecx, line
mov edx, 23
int 0x80
; 输出 ASCII码表 表头
mov eax, 4
mov ebx, 1
mov ecx, table
mov edx, 25
int 0x80
; 输出 分割线
mov eax, 4
mov ebx, 1
mov ecx, line
mov edx, 23
int 0x80
; 输出 ASCII码表 数据
mov ecx, ascii_values
mov esi, 0
mov ebx, 1
loop:
mov eax, 4
mov dl, [ecx + esi]
add esi, 1
mov edx, eax
int 0x80
; 输出 十六进制数值
mov eax, 4
mov ebx, 1
mov ecx, hex
mov edx, 4
int 0x80
; 输出 字符
mov eax, 4
mov ebx, 1
mov ecx, [esi - 1]
mov edx, 1
int 0x80
; 输出 换行符
mov eax, 4
mov ebx, 1
mov ecx, nl
mov edx, 1
int 0x80
cmp esi, 127
jle loop
; 退出程序
mov eax, 1
xor ebx, ebx
int 0x80
section .data
hex db "%-8X", 0
nl db 10
```