World of Spectrum
  • Categories
  • Discussions
  • FAQ
  • Sign In
Home › Search
Title Search
@title beer Word 'beer' in title
User Search
  • @user admin Only posts by Admin
Text Search
  • @body beer Word 'beer' in the text
Phrase Search
"Hello World" Exact phrase match
Exclude Terms
  • car -red Search cars that are not red
"Or" Searches
  • honda | bmw 'honda' or 'bmw' results
Multi-Field
@(title,body) hello Both contain 'hello'
WildCard
  • hond* civ* Match all with an astrix
Combination
  • @title bmw @user admin
See more supported syntax examples
Search Again :: Adv Search 1000 results in 0.015s
<1234567…34>
  • Optimize this assembly?Aiming for Variable*192 -> HL In the first case, I came up with the obvious method - *128 +*64: [code] ld a, (variable) ;13 ld h,0 ; 7 ld l,…

    ... /> ld l, a ; 4

    add hl, hl ;11
    add hl, hl ;11 ... />
    [code]
    LD A,(variable) 13
    LD h,a ; A ... * 256 4

    LD L,0 ; L=0 7 ... *128 10

    ADD HL,BC ; HL=A*192 11
    --
    Gedlion Gedlion August 2010 Development
  • +3 assembler questionI was wondering if anyone could give any suggestions as to how to get this bit of code working on the +2A/+3 in 128k mode. It works on the +128k/+2 i…

    ... ;in LAST_K
    LD BC,9000 ;new line number ... to jump to
    LD (23662),BC ;OLDPPC - CONTINUE line ... - CONTINUE statement number
    LD HL,(23641) ;E_LINE - address of ...
    EX DE,HL
    LD (HL),$e8 ;insert code for ...
    Battle Bunny Battle Bunny August 2010 Sinclair Basic
  • Common pitfalls and solutionsLet's discuss some of the common problems in Speccy programming, and the methods we use to avoid them. For an example, here is a piece of code that …

    ... /> LD HL,#1303
    PUSH HL
    LD (#5C3D),SP
    LD HL,#1BB0
    PUSH HL ...
    LD HL,(#5C4F)
    LD ... /> ADD HL,DE
    LD DE,#1B5E
    EX DE,HL
    LD BC,4 ...
    Hikaru Hikaru August 2010 Development
  • Z80 Machine Code Question...Hi Folks, I know not strictly a BASIC question but I have started to learn Z80 machine code - 25 years too late! :smile: I have been reading a book…

    ... ][FONT="Courier New"]LD BC,1400h
    LD HL,4000h
    LD(HL),FFh
    DEC ... BC
    JR NZ,F9h ... the [FONT="Courier New"]DEC BC[/FONT].

    Am I ...
    Paddy Coleman Paddy Coleman August 2010 Sinclair Basic
  • Using the stack to copy memory blocksA [b]PUSH[/b] and a [b]POP[/b] instruction together take less time than two [b]LDI[/b], so long [b]POP/PUSH[/b] sequences are sometimes used to copy …

    ... /> ld ix, source
    ld hl, dest
    ld de, 8 ; stepsize
    ld a ...
    exx ; 4
    pop bc ; 10
    pop de ; 10 ...
    ajmoss ajmoss August 2010 Development
  • Machine code issue...Hi Folks, My trials with MCODE continue and I am stuck. I wrote the following program in BASIC to simply POKE an attribute byte in to a "box" on th…

    ... LD BC,22528 ;BC=ATTR Address
    09 ADD HL,BC ;HL=HL+ATTR Address
    ED4B01FA LD BC ... ,(64001) ;BC=X
    09 ADD HL,BC ;HL=HL ...
    Paddy Coleman Paddy Coleman September 2010 Sinclair Basic
  • Help needed with simple MCode routineI'm trying to code a routine to clear the screen and I can't figure out why it's not working: ld hl,16384 ld bc, 6144 loop:ld (hl),0 inc hl dec bc l…

    ... /> ld hl,16384
    ld bc, 6144
    loop:ld (hl),0
    inc hl
    dec bc ...
    ld a ...
    Rebelstar without a cause Rebelstar without a cause November 2010 Development
  • Why doesn't my loop work?Can anyone help me understand why my loop doesn't work? Is it to do with how DEC HL affects the flags? [code] ; Read 32k bytes from port 191 as fa…

    ... to do with how DEC HL affects the flags?

    LD BC,191 ; Port to IN from
    LD HL,32767 ; Number ... of bytes to read
    LD DE, ... loop: IN A,(C)
    LD (DE),A
    INC ... DE
    DEC HL
    JR NZ,loop < ...
    trellis trellis December 2010 Development
  • A fast DRAW routineI was investigating how to speed up the line drawing for the [URL="http://www.worldofspectrum.org/forums/showthread.php?t=20225"]BASIC compiler[/URL]…

    ... (hl)

    __DRAW_START:
    ld (__PLOTOVER), a

    exx
    ld bc ... Address of pixel

    ld bc, (COORDS) ; B,C = y1, x1 ...
    add hl, bc ; error += dY
    exx

    ld a, e ...
    boriel boriel December 2010 Development
  • Help?Hi All, I wonder if anyone has a few minutes to look at this bit of code I'm working on. I'm trying to move to sprites and want to do it with a scr…

    ... /> [CODE]org 33000
    keys ld bc,63486 ;press 1 and the ... ;repeat 8 times
    ld hl,bits ;reset bits (lines of ... from top
    ld (point),hl
    ld hl,seed ;screen address table ... halt
    ret
    sprite ld hl,(point) ;address of current line ...
    R-Tape R-Tape January 2011 Development
  • Small Machine Code Routines Which Maybe UsefulAs part of creating Flynn's Adventure in Bombland I created a lot of little routines to do all sorts of things. A lot of these I created based on inp…

    ... /> add hl,hl ; 11t - x4
    add hl,hl ; 11t - x8
    ld bc,$3C00 ; ... 11t - ROM font mem location ($3C00)
    add hl,bc ; ... 11t - move hl to correct position in ... with previous plot byte
    ld (hl),a ; 7t - plot ...
    TomD TomD April 2011 Development
  • Frank N SteinThis is an improved bugfix for [URL="http://www.worldofspectrum.org/infoseekid.cgi?id=0001849"]Frank N Stein[/URL] as discussed recently in [URL="htt…

    ... $C472 ; 50290
    PATCH1: POP BC ; 193
    CALL $81A4 ; 205 ...
    DEC HL ; 43
    DEC HL ; 43
    LD SP, HL ; 249
    Einar Saukas Einar Saukas May 2011 Infoseek database
  • Shadow ROM partial decoding not implemented in emulatorsOr at least, not implemented in Spectaculator, and it seems that not in Fuse too. [URL="http://www.speccy.org/foro/viewtopic.php?f=8&t=408&start=53"…

    ... di
    ld hl,StartCopy
    ld (5cedh),hl
    rst ... /> StartCopy ld hl,0
    ld de,32768
    ld bc,16384
    mcleod_ideafix mcleod_ideafix June 2011 Emulators
  • (part of) screen to UDGHere is a routine to copy a Y,X-position on screen to a UDG. 0<=y<=23 0<=x<=31 144<=udg<=165 (UDG "A" to UDG "U") [code] ; start code with ; PRINT …

    Here is a routine to copy a Y,X-position on screen to a UDG.
    0
    Dr BEEP Dr BEEP June 2011 Development
  • automatic relocating of non-relocatable codeI was pondering upon the problem of changing absolute addresses used by CALL, JP, etc. when code is moved, without reassembling at the new location; …

    ... : ld (STACKP),sp ;save stack pointer
    ld hl,CHANGE
    add hl,bc
    ld ... sp,hl ;point SP to ...
    Battle Bunny Battle Bunny August 2011 Development
  • machine code loadercan someone have a look at this loader and break down what its actually doing and also how i can stop it from executing the 2 loads of headerless blo…

    ... [CODE]
    5B00 LD SP,5BFF
    5B03 LD A,(5C48)
    LD (5C48),A
    5B0B LD HL,5800
    5B0E LD BC,02FF
    5B11 XOR A
    5B12 LD (HL ... ),A
    5B13 INC HL
    5B14 DEC BC
    5B15 LD ...
    djgarf djgarf August 2011 Sinclair Miscellaneous
  • Keys redefine routine and key check.I have written some asm code which allows me to redefine keys (for a game etc.), and also allows me to be able to check any keypresses for the redefi…

    ... print_message
    ld hl,key_left_port
    call get_defined_key

    ld hl,msg_right

    ; -----------------------------------------------
    delay: ld bc,32768
    ld a,0
    d_loop ...
    polomint polomint September 2011 Development
  • Tile based graphics and scrolling thingy...Here's my best attempt so far at a tile based rendering and scrolling routine. It draws in 22 8*8 graphics tiles along the top of the screen (junk i…

    ... hl,hl ; ASCII code * 8
    add hl,hl
    add hl,hl

    ld de ...
    push bc
    push af

    ld (32859),sp ; Preserve ... af
    pop bc
    pop de
    pop hl ;

    Zoltar Zoltar September 2011 Development
  • Lord Of The Rings; Files skipped ?Hi folks, Does anyone know what blocks 8~13 are for in the Lord of The Rings: [url]http://www.worldofspectrum.org/infoseekid.cgi?id=0006601[/url] I…

    ... 61440 LD HL,61440
    61443 LD DE,23296
    61446 LD BC,00144< ... 61584 ADD HL,BC
    61585 JR 61520
    61587 LD H,(IX ... HL
    61671 POP DE
    61672 INC DE
    61673 LD BC ... ,00012
    61676 LD (HL),000
    61678 ...
    Andrew Barker Andrew Barker October 2011 MIA/STP/SDP
  • AND,XOR,OR,BIT,RES,SET,CPL,NEG,RLC,RRC,SLA,SRL,RL, RR,SRA for BASICAs this was drifting away from the original INKEY$ thread I thought that I'd create a new one. So here's a routine to provide all of the above mentio…

    ...
    rst $20
    ld bc,15
    ld hl,OPTIONS+14
    cpdr ... af
    ld hl,OPCODES
    add hl,bc
    add hl,bc
    ld de,OPERATE ...
    Battle Bunny Battle Bunny October 2011 Sinclair Basic
  • Is it possible to access the +3 disk drive via m/c in USR0 mode?Is it possible to access the disk drive of the +3 via m/c +3DOS calls when running in USR0 mode? I ask because I'm having an awful lot of trouble ge…

    ... /> ld ($9000),sp ; 36864
    ld bc,$7ffd
    ld a,($ ... ld e,1
    ld hl,filename
    call 262

    ld bc ... ld bc,1
    here push bc

    di
    ld bc, $7ffd
    ld ... /> di
    ld bc,$7ffd
    ld a,($5b5c)
    set ...
    cmonkey cmonkey October 2011 Development
  • BREAK from GOSUBHere's another one. Just in case you wanted to break out of multiple GOSUB levels with a single command, here's a routine to do it, tested on all mod…

    ... [code]
    RETSUB: LD HL, 20 ; 33 20 0 ... BC ; 193
    POP HL ; 225
    POP DE ; 209
    LD ... ;reset ERR_SP
    LD BC,$1B76 ; 1 118 ...
    Battle Bunny Battle Bunny December 2011 Sinclair Basic
  • Procrustean PrintingHere's a short routine to manage printing of text with command tokens, to avoid messing up the screen when they are expanded. It just prints as many …

    ... ;
    STACK: ld hl,14
    add hl,sp
    ld sp,hl ;undo USR ... ;BC=addr
    ld h,b
    ld l,c
    jp (hl) ;JP ...
    Battle Bunny Battle Bunny December 2011 Sinclair Basic
  • Indirect Variable AssignmentHere's another wacky routine. This allows assignment of values to variables where the source & destination variables can themselves be defined in var…

    Here's another wacky routine. This allows assignment of values to variables where the source & destination variables can themselves be defined in variables (or expressions which evaluate to variables). Some of this can already be done with VAL or VAL$, ...
    Battle Bunny Battle Bunny January 2012 Sinclair Basic
  • Undefine functionHere's a routine to selectively remove variables from the VARS area and reclaim the space. This can be done partially from BASIC already by assigning…

    ... de,hl
    add hl,bc
    ld b,h
    ld c,l ;BC=(length ... /> STRARR: inc hl
    ld c,(hl)
    inc hl
    ld b,(hl) ;BC=length of ...
    Battle Bunny Battle Bunny January 2012 Sinclair Basic
  • Loading the display with data from memoryTrying to load part of the screen(4k's worth) with data from memory location 53000, I've written this routine, but it doesnt work... [I]ld b,4000 ld…

    ... ]ld b,4000
    ld de, 16384
    ld hl, 55000
    loop ld a,(hl ... )
    ld (de ... ),a
    inc de
    inc hl
    bc instead but that wont work ...
    daveysludge daveysludge January 2012 Development
  • S-S-Sample black borderI'm wanting the 'S-S-Sample' routine from YS to play the sounds without the flashing border effects. A plain black border is required. Heres the rou…

    ... /> ld hl, (32768 )
    ld de, (32770)
    ld bc, 2048
    ld c, (hl)
    ld a ... , c
    rlca
    ld c ...
    daveysludge daveysludge January 2012 Development
  • joining lines of BASICDue to overwhelming demand - well, one demand - well, more of a suggestion, really - here's a routine to join together lines of BASIC. The vertical c…

    ... de,hl
    add hl,bc ;HL=joined length
    ex de,hl
    ld (hl),e ...
    inc hl
    ld (hl ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • The INPUT command routine ($2089)I was looking at the INPUT routine with a view to modifying the intro so that I could pre-load the workspace and edit an existing value, rather than …

    ... .
    2161 IN-VAR-4 LD (K-CUR-hi),+00 The ... is copied to[/color]
    LD BC,(ECHO-E) [color=red]the ... .
    2174 IN-VAR-5 LD HL,+5C71 This is FLAGX.
    Battle Bunny Battle Bunny February 2012 Development
  • editing strings with INPUT LINEHere's the latest in my unpredictable series of utility routines. This one I needed for the SAGE game editor; it emulates INPUT LINE l$ but with the …

    ... hl
    ld c,(hl)
    inc hl
    ld b,(hl) ;BC=l$ length
    inc hl ...
    push hl ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
<1234567…34>

Latest Posts

  • Your Favorite Magazine Cover Tapes.
    Your Spec-chum on 2:19PM
  • Where to Buy the New or Fairly Recent , Excellent ZX Spectrum Games Software?
    Your Spec-chum on 1:34PM
  • i am currently listening to........
    mel the bell on 11:34AM
  • Mis-labeled cassette titles or a name change?
    harriusherbartio on 11:06AM
  • Ways to preserve Speccy Tapes in the loft
    harriusherbartio on 10:58AM
  • Fixed Speccy Software. And which games remained unfixed?
    harriusherbartio on 10:47AM
  • Minor British Sports that did become games on the ZX Spectrum
    harriusherbartio on 10:30AM
  • How to return to basic properly from ASM
    Paradigm Shifter on 1:54AM
  • Frankie's ZX Spectrum Digouts
    Zup on April 8
  • Elusive Strategy Games done by the Smaller or less Prolific Software Houses.
    harriusherbartio on April 8

HitBox

Word Docs Hits
ld 6.3K 67.3K
bc 3.6K 14K
hl 6.2K 48K

Related Threads

  • DEC BC/LD A,B/OR C/JP NZ,loopyesterday i saw nice trick:[code]<br /> <br /> dec bc<br /> ld a, b<br /> or c<br /> jp nz, loop<br /> <br /> can be replaced (bc starts &gt;255, sho…
  • BC 's Quest For Tireswhen playing this game you can only use keyboard right?.WRONG.if you press the letter "p" while the game has started(paused and waiting for input)a c…
  • BC Bill does this game work with a emulator?Can anyone get this game running with a emulator. I get as far as the main screen but can't start the game
  • BC BillThis is embarrassing but here goes...<br /> <br /> I'm playing BC Bill using ZX32. On the control menu I press 2 to select 'Kempston'. What do I need…
  • Problems with BC bill gameI have loaded this game with several emulators and game files with the same result:<br /> you can choose the input -&gt; sinclair, kempston, etc but …
  • When would you use LD A,R ?Can anyone tell me a practical use of LD A,R and LD R,A I am confused when you would need to use it?<br /> <br /> Cheers
  • Correct flag response to BIT n,(HL) etc.When running the test program suggested by Arjun (thanks again), all intructions are passing the flag tests except the BIT n,(HL), BIT n,(IX+dis) and…
  • Contention: LDI vs LD (ss), rAccording c.s.s. FAQ:<br /> <br /> instruction LD (ss),r breakdowns as pc:4,[b]ss:3[/b]<br /> and LDI as pc:4,pc+1:4,hl:3,[b]de:3,de:1 x 2[/b]<br /> …
  • BC's Quest for Tires code sheet missingSpeaking of [URL="http://www.worldofspectrum.org/forums/showthread.php?t=35314"]missing code sheets[/URL], it appears the sheet for [URL="http://www.…

Related Searches

  • ld ix
  • ld bytes
  • ld hl de
  • return to basic hl
  • ld bc eostr string
  • ld am
  • ld a r
  • ld r a
  • call address in bc
  • call hl
  • ld a b xor c loop
  • ld a b or c loop
  • print usr bc
  • bc bill
  • ld bc 65533 a 254 out c
  • ld bc 65533
  • ld hl 5678
  • 33 ld hl xxxx
  • screen buffer pop bc ld sp hl
  • ld 23641 hl

Copyright © 2024 World of Spectrum