-
Notifications
You must be signed in to change notification settings - Fork 4
/
USR.txt
executable file
·43 lines (36 loc) · 1.85 KB
/
USR.txt
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
USR
-----------------------------------------------------------
[ 機能 ]
機械語で作られたプログラムを実行します。
[ 書式 ]
USR[<番号>](<引数>)
[ 文例 ]
U=USR(0)
M$=USR1("MSX")
[ 解説 ]
DEF USR で指令された開始アドレスから実行を開始します。
<番号> は 0~9 です。省略時は 0 になります。
<引数> は BASIC から機械語へ渡される内容として指定します。
呼び出されたマシン語からは
レジスタ A または &HF663 の値で型を得ます。
値と <引数> の取り出しは次のとおりです。
2 整数型
&HF7F8~&HF7F9 の 2 バイトに <引数> が入ります。
3 文字型
DE レジスタに参照先の番地があります。
参照先の番地には文字列の長さ、
続く 2 バイトが文字列が入っている番地が入ります。
3 バイトはストリングディスクリプタとなっています。
4 単精度実数型
&HF7F6~&HF7F9 の 4 バイトに <引数> が入ります。
&HF7F6 が指数、&HF7F7~&HF7F9 が仮数となります。
8 倍精度整数型
&HF7F6~&HF7FD の 8 バイトに <引数> が入ります。
&Hf7F6 が指数、&HF7F7~&HF7FD が仮数となります。
HL は文字型を除き &HF7F6 のポインターです。
従って 整数型は HL に入っている参照先番地 + 2 になっています。
文字列型に限り DE を参照する事にご注意下さい。
資料によっては A・HL・DE のレジスタのみで記載がありますが、
実際にそのレジスタの値は文字列を除き固定となっています。
返される値は機械語から BASIC へ渡される内容です。
マシン語から BASIC への引き継ぎは <引数> と同じ形にします。