OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [tags/] [INITIAL/] [tests/] [i86/] [02_datatrnf.s] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 zeus
# Recursive testbench for transfer data instructions, except "mov"
2
#  but ("jmp" & "mov" must work!!)
3
#
4
# At the end (3591ns in rtl-model, 274380ns in spartan3), %ax=0x8cf1
5
#
6
# sahf   1
7
# lahf   2
8
# lds    3
9
# lea    4
10
# les    5
11
# pop    6 (reg,non-st), 7 (seg), 8 (mem)
12
# popf   9
13
# push  10 (reg), 11 (seg), 12 (mem)
14
# pushf 13
15
# xchg  14 (reg-reg), 15 (reg-mem), 16 (reg-acum), 17 (reg-reg,byte)
16
# xlat  18
17
# in    19 (byte,imm) 20 (byte,dx) 21 (word,imm) 22 (word,dx)
18
# out   23 (byte,imm) 24 (byte,dx) 25 (word,imm) 26 (word,dx)
19
 
20
.code16
21
start:
22
movb $0xed, %ah
23
sahf                    # (1)
24
lahf                    # (2) Now %ah must have 0xc7
25
movb %ah, %al
26
outb %al, $0xb7         # (19)
27
movw $0xb7, %ax
28
movw %ax, %dx
29
movb $0xa5, %ah
30
inb  %dx, %al           # (24)
31
sahf
32
lahf                # Now %ax must have 0x87c7
33
 
34
outw %ax, %dx           # (22)
35
movw $0xf752, %ax
36
movw %ax, %bx
37
inw  %dx, %ax           # (26)
38
xchg %bx, %ax       # (16)
39
movw %ax, %ds
40
lds  781(%bx), %si  # (3)  %ds=0x5678 and %si=0x1234
41
 
42
movw $-1, %bx
43
 
44
movw $0x1000, %ax
45
outw %ax, $0xb7         # (21)
46
 
47
movw $0x5798, %ax
48
movw %ax, %ss
49
movw $9, %sp
50
movw $0xabcd, %cx
51
push %cx                # (10)
52
movw $0x8cf1, %cx
53
movw %cx, %es
54
push %es                # (11)
55
popf                    # (9)
56
les  -46(%bx,%si), %di  # (5) %di=0x8cf1, %es=%0xabcd
57
lea  -452(%bp,%di), %si # (4) %si=0x8b2d
58
pushf                   # (13)
59
inw  $0xb7, %ax         # (25)
60
movw %ax, %ds
61
pop  1(%si)             # (8)
62
xchg 2(%bx,%si), %di    # (15) %di=0x0cd3
63
push 2(%bx,%si)         # (12)
64
pop  %es                # (7)  %es=0x8cf1
65
pop  %dx                # (6)
66
push %dx
67
.byte 0x8f,0xc1         # (6) pop %cx (non-standard)
68
xchg %bx, %cx           # (14) %bx=0xabcd, %cx=0xffff
69
movw %es, (%bx,%di)
70
movw $0xb800, %bx
71
movw $0xa0a1, %ax
72
xlat                    # (18) %al=0x8c
73
xchg %al, %ah           # (17)
74
xlat                    # %ax=0x8cf1
75
movw $0xb7, %dx
76
outb %al, %dx           # (20)
77
movb $0xff, %al
78
inb  $0xb7, %al         # (23) %ax=0x8cf1
79
 
80
.org 65520
81
jmp start
82
 
83
.org 65524
84
.word 0x1234
85
.word 0x5678
86
 
87
.org 65535
88
.byte 0xff

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.