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.009s
<1234567…34>
  • line routineWondered if anyone can help me out. I have been programming a 3d graphics library for the spectrum, in Machine code. The line routine that I have i…

    ... /> ld hl,&xx00
    ld de,&xx01
    ld bc,&0100
    ld (hl ... /> --your program--

    ld hl,(counter)
    ld bc,hl
    ret

    org &zzzz

    ld hl,(counter ...
    cyborg cyborg October 2001 Sinclair Miscellaneous
  • Fantasy Z80 instructions?This follows on from something catmeows said in another thread, and that I've been meaning to ask for a while. This may sound daft to people with mo…

    Multiply
    Mirror
    LD AF,nnnn
    LD BC,(HL)
    LD DE,(HL)
    joefish joefish November 2012 Development
  • Fantasy Z80 instructions?This follows on from something catmeows said in another thread, and that I've been meaning to ask for a while. This may sound daft to people with mo…

    ... /> Mirror
    LD AF,nnnn
    LD BC,(HL)
    LD DE,(HL)[/QUOTE]


    But also:

    LD HL,(IX) ;there's many an ... (nn)

    maybe CALL (HL) too, but I'm just ...
    R-Tape R-Tape November 2012 Development
  • Scrolling attribute thingJust messing with scrolling attributes. Its absolutely no use, but impressed with the variable speeds of scrolling. [url]https://dl.dropboxusercont…

    Or you could ld bc, hl; clear hl, ld de with a, add hl, de (3 times, so hl = a * 8 - stoopid smileys) and then ld de, bc and add hl, de. Dunno which would be faster... but there's no messing with the carry flag or shifting d involved with that method.
    Paradigm Shifter Paradigm Shifter July 2013 Development
  • Scrolling attribute thingJust messing with scrolling attributes. Its absolutely no use, but impressed with the variable speeds of scrolling. [url]https://dl.dropboxusercont…

    ... ]Or you could ld bc, hl; clear hl, ld de with a, add hl, de (3 ... times, so hl = a * 8 ... ) and then ld de, bc and add hl, de. Dunno which would ...
    SKR SKR July 2013 Development
  • The Pros and Cons of "alternative" assembler syntaxContinuing from [URL]http://www.worldofspectrum.org/forums/showpost.php?p=720754&postcount=72[/URL] [QUOTE=u6c87;720754]But that wouldn't change if…

    ... , stx, movfw, etc... instead of ld). That way surely leads to ... . Things like "ld bc,hl" which gets expanded to "ld b,h; ld c,l ...
    Alcoholics Anonymous Alcoholics Anonymous September 2013 Development
  • Problem with BC corrupting after DJNZJust for fun, I'm messing around trying to get the level maps from Lemmings to display on the screen with machine code. It's been ages since I did an…

    ... br />
    [code]
    MAIN LD HL,50213 ; MAP START ADD

    LOOP1 LD BC,8 ; SET THE COUNTER FOR ... THE LINE COUNTER

    LD BC,32 ; SET THE COUNTER FOR ... /> LD BC,32 ; 32 TO ADD TO THE MAP ADDRESS
    ADD HL,BC ...
    mulder mulder January 2016 Development
  • Sort 2 byte words (x, y) on ypos, also question about swap (DE), (HL)Well that was a lot of debugging ;) But if you want a routine which takes an array of 16 byte words x, y and then sort them on y (ignoring x), I'm…

    ... af' ; 4
    ld a, (de) ; 7
    ld (hl), a ; 7
    hl, de
    .dontcheckright
    ld a, c ; A = largest
    pop bc ... /> push bc
    ld a, b
    ld b, c
    ld c, ... /> ex de, hl
    swap_word
    push bc
    ld c, 0
    Paradigm Shifter Paradigm Shifter July 2022 Development
  • Short Z80 QuizQ1) Which program gives different result ? A) XOR A ADD A,A B) XOR A ADC A,A C) SCF ADD A,A D) SCF ADC A,A Q2) What is the equivalent of NEG …

    ... HL
    DJNZ LOOP
    RET

    B)
    LD BC,10 ...
    LD HL,60000
    LOOP: LD (HL),C
    INC HL
    DEC BC ...
    LD A ...
    Dr BEEP Dr BEEP July 2002 Games
  • FAST PIXEL DRAWINGI'm looking for the fastest way to put a pixel to the screen (on spectrum ofcoz:). Here is my own procedure (written in PASMO). But I don't how do it…

    ...
    ld c,a
    ld a,(bc)

    ld b,(hl)
    or ... b
    ld (hl),a ...
    zxmaniac128 zxmaniac128 May 2004 Development
  • IM 2 interrupts and smooth scrolling - easy peasy!Okay, been fiddling around with IM 2 and have actually mastered (I think) how to use IM 2! Now I run my game Ragnar Revival in IM2 and use HALT to sy…

    ...
    push hl
    ld hl,16384
    inc (hl)
    pop hl
    ei ...
    ld bc,260 ;229*256+229, i.e 58853
    ld (hl),229 ... : lsb,msb
    ld (hl),0BAh
    inc hl
    ld (hl),088h

    ekoman ekoman July 2004 Development
  • Pixel setting / general speccy codingi just started doing some cross-coding with the [url="http://www.bigfatpanda.fsnet.co.uk/z80.html"]Z80 SNA assembler[/url] and an emulator, and this …

    ... /> ld a, c
    and 7
    ld c, a
    add hl, bc ...
    ld b, (hl)
    ex de, hl
    ld ... a, (hl)
    xor ...
    Lambchop Lambchop August 2004 Development
  • need help with speed optimization. this procedure draws a sprite with mask from memory onto the screen with x-coordinate in pixels. it doesn't shift sprites in realtime, it just uses …

    ... C
    LD (HL),A
    INC HL
    POP BC
    DJNZ DRAWMID ... /> OR C
    LD (HL),A

    POP BC ;restoring data needed ...
    moroz1999 moroz1999 August 2004 Development
  • Calculate screenaddressWho knows where the topic about the fastest screenaddressroutine is? I can't find it in a search.. The fastest routine was to load a large table of …

    ... space needed.


    BC holds Y/X

    LD L,C
    LD A,(HL) ; first part of ... H
    LD H,(HL) ; Fetch Hi-byte
    LD L,A
    RET ; HL holds screenaddress
    Dr BEEP Dr BEEP August 2004 Development
  • Machine Code Sprites Example Code Using Char Based SystemBelow is my WIP code to do smooth screen wrapping sprites using char positions and offsets, as opposed to writing direct to a line (0-191) and shifti…

    ... br /> Spriteloop:
    PUSH BC

    CALL MoveSprite ... LD D,0
    LD HL,gfx
    ADD HL,DE ... Exit
    ; HL Contains Screen Address
    ; BC preserved
    ...
    robpearmain robpearmain August 2004 Development
  • IM2 Machine Code Sprites Example Code Using Char Based SystemFurther to my earlier post, here are sprites running using char method with IM2 driving it Note, for 48k spectrum using TASM [code] ; ***********…

    ... +3)
    LD D,0
    LD HL,gfx
    ADD HL,DE

    ld hl,0FE00h ;Building up a table with
    ld bc,0FDh ;253 ... /> pp1:
    ld (hl),C ; LD (0FE00h),FDh
    inc hl ; repeate 253 times ...
    robpearmain robpearmain August 2004 Development
  • Smooth Color Masked Sprites using fast page flip on 48kHere is a quick demo of using char based sprites using the Page flip method: a) Background is copied to buffer b) Sprites drawn on buffer c) Buffer …

    ...
    LD HL,BACKGROUND
    LD DE,BACKGROUND+1
    LD BC,1B00h
    LD (HL),%01000111 ... />
    LD HL,0FE00H ;BUILDING UP A TABLE WITH
    LD BC,0FDH ;253 ...
    robpearmain robpearmain September 2004 Development
  • Smooth Masked Sprites using fast page flip on 48k Part 2Ok, After all the suggestions in Part 1, which were all excellent (Thankyou), I opted on the following: I have 2 x 6k Offscreen areas (Yes, that's …

    ... /> LD HL,BACKGROUND
    ; LD DE,BACKGROUND+1
    LD BC,0C00h
    prelp:
    LD (HL ... ),%11111111
    INC HL
    LD (HL),%00000000 ...
    robpearmain robpearmain September 2004 Development
  • Smooth Screen Scrolling RoutineHi everyone, this is a follow up to the thread on smooth screen scrolling. As promised here is the code for the routine. It's pretty long and fairl…

    ... /> LD (HL),B

    LD BC,1760
    SBC HL,BC

    POP BC
    LD (HL ... /> LD (HL),B

    LD BC,1760
    SBC HL,BC

    POP BC
    LD (HL ...
    dmsmith dmsmith September 2004 Development
  • The incredible shrinking screendumpIn this topic I stated that I would be impressed if the screendump could be smaller than 37 bytes. [url="http://www.worldofspectrum.org/forums/viewt…

    ... , B 0
    nline ld hl,table-1 ; Use JR value ... B-reg
    prtab inc bc ; Start of tableprinting
    ... next byte in table
    ld e,(hl) ; Fetch 'last' byte ... in table
    prbyte ld a,(hl) ; Fetch byte for print ...
    Dr BEEP Dr BEEP September 2004 Development
  • Anyone help re-factoring a tile functionI had some excellent feedback for re-factoring my function that displays the colour for my screen tiles. Can anyone offer some help to improve the fu…

    ...
    POP DE
    POP BC
    INC E
    INC ... ,(HL)
    LD (DE),A
    INC HL
    INC E
    LD A,(HL ...
    Mr Millside Mr Millside February 2005 Development
  • Fastest way to write something to screen$Hi, I just got pasmo.exe and start playing with attr scrolling, well, not scrolling, just write different values to a block and see if I can introdu…

    ... sure about the push vs ld (hl),a.
    NOTE: ... LD (OLDSP),SP
    LD SP,base+len
    LD BC,len/2
    LD ... D,val1
    LD E, ... PUSH DE
    DEC BC
    LD A,B
    OR ... /> JR NZ,LOOP
    LD SP,(OLDSP)
    ENDM ; ...
    AE.Vasconcelos AE.Vasconcelos April 2005 Development
  • Programming MC : first stepsIsn't nice to collect all kinds of short routines to help making the first steps into MC for everyone who never touched MC? What I mean is mostly th…

    ... />
    start ld hl,(23672)
    ld (seed),hl ; RANDOMIZE equivalent
    ld a,6 ... push hl ; save registers
    push bc ; save registers
    ld c,a ...
    Dr BEEP Dr BEEP August 2005 Development
  • Optimisation Needed! Is this the Fastest way to copy bytes from screen and back again?I have the screen address (say 0,0 i.e 16384) I want to copy 4 bytes wide by 32 bytes high from the screen to an area of memory. I then want to cop…

    ... />
    ld hl,16384
    ld (hl),0
    ld de,16385
    ld bc,6143
    robpearmain robpearmain November 2005 Development
  • Machine Code: quicksort optimisationI came across this z80 quicksort implementation when going through the wikipedia article on the same. It's 44 bytes long. I was wondering if any of …

    ... hl,bc
    jp c,next2
    ld a,(bc) ;swap (bc),(de)
    ld h ... /> ld (bc),a
    ld a,h
    ld (de),a
    pop hl ;restore ...
    Arjun Arjun January 2006 Development
  • Spin save dissembly problemHey Dunny and others Spin dudes! There seems to be a small problem with the save dissembly function from the dissembler in Spin. This is the exact o…

    ... : push bc ; 26562 11ts
    push de ; 26563 11ts
    ld hl, l29699 ... ; 26564 10ts
    ld (26511 ), hl ; 26567 16ts
    ld hl, l29735 ...
    Kiwi Kiwi May 2006 Emulators
  • Problem with rotating procedureHi folks! I wrote a proc in z80 asm, based on: x' = x * cos (z) - y * sin (z) y' = x * sin (z) + y * cos (z) I used a precalculated table of sin a…

    ... /> ld hl,cosx
    add hl,bc
    ld e,(hl)
    inc hl
    ld d,(hl)
    ld hl ... /> ld hl,sinx
    add hl,bc
    ld e,(hl)
    inc hl
    ld d,(hl)
    ld hl
    xor xor July 2006 Development
  • In Machine Code, what is the quickest way to sort bytes?I am playing around with some ordering of sprites, where I want to order them by vertical position. I used some Rodnay Zaks code to order some bytes…

    ... /> ld hl,numbers
    ld bc,7

    bubble ld (temp),hl ; temp = (hl)
    again ld ... ix,(temp) ; ix=(hl)
    res ...
    robpearmain robpearmain August 2006 Development
  • Pimp my code...Erm, this is just the result of a mental exercise - I wanted to repeatedly display a UDG but decided against using a ROM routine and UDGs! Any sugges…

    ... /> ld hl,#4000
    ld b,#08
    ;
    loop push bc
    ld a ...
    inc de
    ld bc,#0100
    ld (hl),a
    ldir
    pop bc
    djnz loop
    jp jp August 2006 Development
<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