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.004s
<1234567…34>
  • Relocation with SDCCI desperately need auto- relocation with SDCC. Something that will compile all of my code using start address 0 and generate relocation table so that…

    ...
    pop hl
    pop bc
    pop de
    ex ... /> ; e = char c
    ; bc = size_t n

    ld ... ) ; remember current char
    cpi
    jr z, match ; ... match:

    dec hl ; cpi stepped hl one past last ...
    Alcoholics Anonymous Alcoholics Anonymous June 2013 Development
  • Experimenting with turboloadersHello, My first post, having lurked here for a while. I'm a lifelong computer nerd, Spectrum fan since childhood in the eighties, and have recently…

    ... checksum
    pop bc ; fetch data ... /> dec bc ; decrement data length
    push bc ; save ... .verify_checksum:
    push bc ;exit code assumes data length ...
    stephenw32768 stephenw32768 August 2013 Development
  • Can a guy that traveled on the short bus learn machine code...Hmmm So after some soul searching I figured it was time to finaly nail spectrum machine code. Its so frustrating to sit infront of a basic listing w…

    ... /> After that its time to decrement the register.

    At ... we are already playing with BC to clear the registers, why ... [/IMG]

    Register Pair BC:

    [code]
    010200 ... ...

    LD BC,0000
    DEC BC
    RET

    wibble wibble August 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... addresses in HL: use the CPI instruction, which performs a comparison ... ), then increments HL and decrements BC. It's designed for scanning ... the P/V flag when BC reaches zero, so you can ... /> ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    gasman gasman October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... /> ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    ld hl, 16384
    ld bc, 1024
    ld d, 62 ... :
    ld (hl), d
    cpi
    jp pe, loop
    David Jones David Jones October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    [QUOTE] ld hl, 16384
    ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    jp pe, loop
    ret[/QUOTE]

    Great trick!
    I've never used CPI in my life before.
    But I guess I'll be using it now :)
    Ralf Ralf October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... ld hl, 16384
    ld bc, 1024
    ld d, 62 ... /> ld (hl), d
    cpi
    jp pe, loop
    ld bc, #1024
    loop2:
    ldi ... /> jp pe, loop2 ; Test bc and loop
    ret
    u6c87 u6c87 October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... nice, both the use of CPI, and the tweaking above. At ... /> ld hl, #byte_to_write
    ld bc, #1024
    loop2:
    ldi ... "
    jp pe, loop2 ; Test bc and loop
    ret
    jamorski jamorski October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... that doesn't show DEC BC/LD A,B/OR C ... . Whats the point of exploiting CPI when you do not know ...
    catmeows catmeows October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... that doesn't show DEC BC/LD A,B/OR C ... . Whats the point of exploiting CPI when you do not know ...
    Arjun Arjun October 2013 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... ld hl,$stringstart
    ld bc,$bytes
    loop:
    cpi
    jp pe,loop
    ld bc,$bytes
    ld d,$ ... /> ld (hl),a
    cpi
    jp pe,loop
    Einar Saukas Einar Saukas January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... ld hl,StringAddress
    ld bc,StringLength
    .lp0
    ... /> ld (hl),a
    cpi
    jp pe,.lp0
    ld bc,StringLength
    .loop
    ... ld de,StringAddress
    ld bc,StringLength
    .lp0
    ...
    Hikaru Hikaru January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    This just sorta came up all of a sudden.

    [code]InPlaceV2
    ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop
    rr (hl)
    jr nc,.loop
    cpi
    jp pe,.loop
    ret[/code]
    Hikaru Hikaru January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    Einar Saukas Einar Saukas January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    antoniovillena antoniovillena January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    Dr BEEP Dr BEEP January 2014 Development
  • How to print logo onto screen at chosen coordinates?Hi, I've just got back into zx spectrum games after all these years and after seeing some of the great games on here I would like to start learning p…

    ... of our font.
    ld bc,728 ; 96 chars * 8 rows ... byte of new.
    dec bc ; decrement counter.
    ld a,b ... /> jr nz,font1 ; repeat until bc=zero.
    ld hl,60000 ...
    alienbanana alienbanana February 2014 Development
  • Animated attribute revealA new challenge to solve next. I would like to create an animated attribute reveal in machine code by having my 768 byte attributes held in ram whic…

    ... of the difference and inc/decrement the attributes accordingly - but ... /> ld bc,0
    ld (CHANGED),bc
    ld bc,1024 ; ... INK_OK: ld bc,(CHANGED)
    inc bc
    ld (CHANGED),bc
    ex ...
    Battle Bunny Battle Bunny February 2014 Development
  • Pac-Land: can be coloured?All versions of this game are full coloured, but not the Spectrum version. It has large sprites, but maybe the scroll is too fine to make a coloured …

    ... ;attribute area
    LD BC,640 ;nr of chars < ... DE
    CPI ;INC HL,DEC BC no change DE
    BC=0

    DrawBottomAttr ... bottom part
    LD BC,160 ;nr of chars
    CPI ;INC HL,DEC BC no change DE
    Ralf Ralf February 2014 Games
  • LDI questionWhen using LDI (or LDD) is it possible to access the value that is transfered from (HL) to (DE), or does the Z80 use an internal data cache to store …

    ... .
    PF flag Set if BC not 0.
    SF, ZF ... 't work the same as CPI where the flags indicate if ... and Z flags like the CPI instruction does.
    Basher Basher March 2014 Development
  • Address bus contents (i.e. PC) during execution of HALTI'm wondering if anyone can tell me what's placed on the address bus during execution of HALT, beyond the initial M1 cycle. The Z80 user manual state…

    ... behaviour of the LDI and CPI instructions. As in this thread ... HL, the fifth is decrementing BC and PC.

    So ...
    Jonathan Harston Jonathan Harston March 2014 Hardware
  • LDI questionWhen using LDI (or LDD) is it possible to access the value that is transfered from (HL) to (DE), or does the Z80 use an internal data cache to store …

    ... LDI is HEX A0
    CPI is HEX A1

    decrement DE and transfer byte/update ... 't work the same as CPI where the flags indicate if ... and Z flags like the CPI instruction does. [/QUOTE]

    Basher Basher March 2014 Development
  • Double-Buffer ScreenFor my Alien Breed Speccy re-write I decided to use a Double Buffer (DB) or 'Back Screen' to draw all the game action onto, before shuffling the whol…

    ... /> call transfer_back_to_front
    pop bc
    inc c
    ... /> generate_screen_table:
    ;
    ld bc,0 ; first clear the x ... , :)
    dec d ; decrement the loop...
    ld a ...

    ld bc, screen_table ; remove this if you ...
    polomint polomint April 2014 Development
  • Sorting BusinessThis is a little bit different from the usual game-related fare but I know there are a few people here who like this sort of thing. This is about so…

    ... array_lo
    ; hl = array_hi
    ; bc = size
    ; ix = compare

    add hl,bc
    push hl ; save array_hi ... increment "balance". Whenever you decrement "j" also decrement "balance". Now change ...
    Alcoholics Anonymous Alcoholics Anonymous May 2014 Development
  • clear a windowed area of the screenHi everyone! Ain't been on here for donkeys, but have recently started messing around with a little game. I'm looking for ideas/opinions on the bes…

    ... ;: RANDOMIZE cols+256*rows: LET bc=USR ClearWindow
    ; row,col ... =rows
    ld b,0 ;BC never exceeds 32, so B ... row
    dec (ix+1) ;decrement rows counter
    ret z ...
    Battle Bunny Battle Bunny October 2014 Development
  • Detecting flash mode inversionsIs is possible to detect with certainty when flashing characters change from normal to inverted and vice-versa?

    ... *8: PAUSE 8:
    LET bc=USR 23296:
    NEXT r ... ;: RANDOMIZE cols+256*rows: LET bc=USR FlashWindow
    ; row,col ... row
    dec (ix+1) ;decrement rows counter
    ret z ...
    Battle Bunny Battle Bunny November 2014 Development
  • ZERO Emulator - BugsI have been using Zero emulator to experiment a few routines in assembly, since it has a somewhat usable debugger. However I believe I found a few b…

    ... make similar use to "DEC BC", and actually detect a zero ... instructions have to repeat until BC==0 so they have ... and you want to 'dec bc' and repeat if not ... :

    [code]
    cpi
    jp pe, loop_again
    inc hl
    dec bc
    ld a,b
    Alcoholics Anonymous Alcoholics Anonymous July 2015 Emulators
  • Subtract 4 from an addressThis is a novice Z80 question really: I'm trying to vertical scroll my back buffer, but I'm not sure of the quickest way to apply an offset and mo…

    ... a 256 bytes boundary, and decrement a single register only. Thus ... :

    [code]
    ld bc,26*256+26*18 ; repeat ... times, plus compensate LDD decrementing BC
    loop:
    REPT 18 ...
    Einar Saukas Einar Saukas September 2015 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…

    ... LOOP PUSH DE
    LD BC,32 ; SET THE COUNTER FOR ... POP DE
    LD BC,32 ; 32 CHARS TO THE ... LINE
    ADD HL,BC ; GET TO THE NEXT ... br /> JR NZ, LOOP ; DECREMENT THE LINE COUNTER AND LOOP ... ; NEXT ADDRESS
    LD BC,511 ; 511 MORE CHAR SQUARES ...
    mulder mulder January 2016 Development
<1234567…34>

Latest Posts

  • Your Favorite Magazine Cover Tapes.
    dm_boozefreek on 4:45PM
  • Happy 40th Birthday to the Amstrad CPC464!
    dmsmith on 4:10PM
  • "Late Entries"
    harriusherbartio on 4:00PM
  • How Do You Categorize Your Speccy Software and Games?
    harriusherbartio on 1:34PM
  • Simple Sprite Routine
    dmsmith on 1:25AM
  • I am currently watching.....
    zx1 on April 11
  • Today's BASIC program: visit attribute cells I am interested in, in pseudorandom order
    Paradigm Shifter on April 11
  • How do you share programs online?
    firelord on April 11
  • Celebrity deaths...
    Ælita on April 11
  • Who Has Got The Earliest ZX Spectrum Software?
    harriusherbartio on April 11

HitBox

Word Docs Hits
cpi 101 164
decrement 190 311
bc 3.6K 14K

Related Threads

  • 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…
  • 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…
  • 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 …
  • CPI emulationI'm currently writing Sinclairean's emulation assembly for the CPI/CPD/CPIR/CPDR instruction group. Does anybody know what exactly the behavior of th…
  • 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.…
  • SBC IX,DE/BCAlways wondered why there wasn't a SBC IX, DE/BC command....<br /> <br /> so have to use<br /> <br /> PUSH HL ; save original HL<br /> PUSH IX ; …
  • Fuse tests - INC BC causes contention delayHi all,<br /> <br /> In the FUSE test suite it has the following for the output of opCode 0x3 (INC BC):<br /> <br /> 0 MC 0000<br /> 4 M…
  • 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…

Related Searches

  • ld bc eostr string
  • call address in bc
  • print usr bc
  • bc bill
  • bc ill brown
  • bc bill brown
  • bc kid
  • usr bc register
  • usr bc register address
  • 14 bc b9
  • cpi
  • print bc assembler
  • ld bc hl
  • otdr decrement
  • ay envelope decrement
  • cpi copy
  • decrement screen line
  • bc
  • cpi ldecrement bc
  • cpi ldecrement bc chris pile

Copyright © 2024 World of Spectrum