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 898 results in 0.001s
<1234567…30>
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... vars=FN p(23627): LET defadd=23563
    32 LET udg=FN p ... ,FN d(deftmp): POKE nxtlin+8,FN d(deftmp+9):
    POKE defadd,FN ... l(deftmp): POKE defadd+1,FN h(deftmp)
    Battle Bunny Battle Bunny April 2011 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... variable was found in the DEFADD area then Stack Variable is ... later post:
    LET m$=FN m$("S",0,"-",16384+2048 ... s$, and:
    LET m$=FN m$("-",16384+2048,"S",0 ... 's occurred to me that FN m$() could handle both string ...
    Battle Bunny Battle Bunny April 2011 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... variable was found in the DEFADD area then Stack Variable is ... later post:
    LET m$=FN m$("S",0,"-",16384+2048 ... s$, and:
    LET m$=FN m$("-",16384+2048,"S",0 ... 's occurred to me that FN m$() could handle both string ...
    Paddy Coleman Paddy Coleman April 2011 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... s an updated version of FN m$() which handles string slicing ...
    [code]
    2 DEF FN p(a)=PEEK a+256 ... (v/256):
    DEF FN d(a)=a-(64 AND ... br />
    13 LET nl=FN p(23637): RETURN:
    REM ...
    16 POKE nl+5,FN d(PEEK da): POKE nl ...
    Battle Bunny Battle Bunny April 2011 Sinclair Basic
  • checking bits in BASICThe question of manipulating bit patterns in BASIC was raised recently in this [thread=35728]Keys redefine routine and key check[/thread] thread. I s…

    ...
    [/CODE]

    DEFADD is the address of arguments ... "0000000000000000" inside the DEF FN, so if you change it ... 7 DEF FN h(h$)=16*FN n(h$(1))+FN n(h ... /> 2030 PRINT "FN b$(j)",FN b$(j,FN x(a$))
    FN x(a$).

    mattsteel mattsteel September 2011 Sinclair Basic
  • checking bits in BASICThe question of manipulating bit patterns in BASIC was raised recently in this [thread=35728]Keys redefine routine and key check[/thread] thread. I s…

    ... reason for combination with DEF FN.
    Still treasures can be ... useful DEF FN because all variables are vectorized from DEFADD and because ...
    mattsteel mattsteel September 2011 Sinclair Basic
  • INSTR function...Hi Folks, Another little program that people might find useful: [CODE]100 DIM i(4) 110 LET a$="This is some sample text" 120 LET b$="text" 130 GO S…

    ... p, defined as a DEF FN plus a *small* (117 ...
    [CODE]
    1 DEF FN i(n,t$,s$)=USR ... /> 5b00 dd2a0b5c LD IX,(5c0b) ; DEFADD
    5b04 010000 LD BC ...
    [CODE]
    1 DEF FN i(n,t$,s$)=USR ... /> 3 DEF FN h(h$)=16*FN n(h$(1))+FN n(h ...
    mattsteel mattsteel September 2011 Sinclair Basic
  • INSTR function...Hi Folks, Another little program that people might find useful: [CODE]100 DIM i(4) 110 LET a$="This is some sample text" 120 LET b$="text" 130 GO S…

    Here's a recursive DEF FN INSTR one-liner, cunningly contrived ... it in a separate function "FN c(c,o$)" didn't ... I thought that maybe "DEF FN c()=c+LEN o$-1 ... the VARS area rather than DEFADD and there they are not ... />
    [code]
    4 DEF FN i(w$,o$,c)=
    Battle Bunny Battle Bunny September 2011 Sinclair Basic
  • 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…

    ... /> Main proc
    ld hl,(DEFADD)
    inc hl
    inc ... byte expressions, write:
    [code]FN z(first_expression,second_expression,"&")[/code ... ]FN z(FN z(a, FN z(b,0,"~"),"&"),FN z(b, FN z ...
    mcleod_ideafix mcleod_ideafix October 2011 Sinclair Basic
  • 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…

    ... ]

    Yes, using FN so that the USR function ... pick up parameters from the DEFADD area simplifies the syntax, ... only specified in the DEF FN. Your code is easy ... nested function rather than just FN z(a,b,"^").
    ... I could use DEF FN a(a$)=USR address+ ...
    Battle Bunny Battle Bunny October 2011 Sinclair Basic
  • stuck on recursive functionI want this function to PEEK 'l' bytes from memory starting at 's' and return them as a string, but however much I fiddle about with quoting and pare…

    ... $ ... + VAL$ bit, the FN j$ bit and the """""" bit ... byte from memory;
    * ("FN j$("+STR$ (s+1)+","+STR ... decrements the counter and calls FN j$(s,l) again ... ) and then VAL$ sees "FN j$((56169),(7))" and so ... iteration creates a new DEFADD area for its version ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... />
    Using a separate DEFADD area to hold single letter ... assignments won't work but DEFADD variables will still be ... subscripted, as SCANNING deals with DEFADD variables differently and doesn't ... then string functions such as FN s$(), STR$ and CHR$ ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ...
    Using a separate DEFADD area to hold single letter ... won't work but DEFADD variables will still be ... as SCANNING deals with DEFADD variables differently and doesn't ... then string functions such as FN s$(), STR$ and CHR ... use of the DEF FN memory move. If I ...
    Paddy Coleman Paddy Coleman February 2012 Sinclair Basic
  • Poking a string to memory...I'm looking to poke a string of characters including colour control codes to memory, I'm currently doing it by hand: 16,2,19,1,22,1,1,144 That equa…

    ... sets up a dummy DEF FN of a$:

    [CODE ... DEF FN[/CODE]
    Next we need to alter the DEFADD (23563 ... an empty string and the DEFADD system variable to its default ...
    Paddy Coleman Paddy Coleman March 2012 Sinclair Basic
  • BASin v.15 DEF FN bugThe bug would appear to be in "BASSupport.pas : Procedure ProcessDEFFN"; as it's not inserting the 6-byte variable place holder after each parameter …

    Any DEF FN which has parameters works in ... v.15; eg:
    DEF FN p(a)=PEEK a+256 ... called because the DEFADD variables area for the FN does not get ... passing syntax, so every DEF FN gets treated as having no ...
    Battle Bunny Battle Bunny April 2012 Emulators
  • BASin v.15 DEF FN bugThe bug would appear to be in "BASSupport.pas : Procedure ProcessDEFFN"; as it's not inserting the 6-byte variable place holder after each parameter …

    ... Bunny;619146]Any DEF FN which has parameters works in ... because the DEFADD variables area for the FN does not ... syntax, so every DEF FN gets treated as having no ...
    By the way, DEF FN bug was caused by the ... $CE (which is DEF FN) in the string sometimes). ...
    Arda Arda April 2012 Emulators
  • simplest method to pass a string to m/code?The statement "RANDOMIZE numvar+USR mc" is a simple way of passing a single numeric parameter to a m/c routine, as mc can retrieve numvar from the to…

    ... USR call in a DEF FN and calling it with a ... .
    [code]
    10 DEF FN a(s$)=USR 4e4
    FN a(s$)
    [/code]

    The address of DEFADD ...
    BloodBaz BloodBaz April 2012 Sinclair Basic
  • Need to scroll one column using m.c.I've used many of the available routines to scroll the entire screen in any direction, but I'm not being able to find one that would allow me to scro…

    ... br /> [code]
    DEF FN l(c,t,b,a ...
    ...
    LET bc=FN l(column,top,bottom,attributes ... SL2: ld ix,(23563) ;IX=(DEFADD)

    NEXTROW:ld b ... /> [code]
    1 DEF FN l(c,t,b,a ... USR 23296:
    DEF FN r(a,z)=a+INT ...
    Battle Bunny Battle Bunny May 2012 Development
  • question re. STR$ bugCould someone point me to whereabouts in the ROM this goes wrong? [code]PRINT PAPER 5;1;STR$ 234[/code] (Only the "1" prints in cyan.) It's not the m…

    This routine (48 bytes) provides a BASIC replacement for STR$ which fixes those two bugs; use "FN s$(numeric_expression)" instead of "STR$ numeric_expression". I copied the ROM's method used in CIRCLE & DRAW for checking -1
    Battle Bunny Battle Bunny May 2012 Sinclair Basic
  • General purpose full screen input routineHi Folks, One of the things that annoyed me back in the 1980s with most BASICs was the lack of a full screen "formatted" input function. You could …

    ... :
    [code]
    100 DEF FN a(a,b,c,d ... are using the DATADD and DEFADD system variables here. Can you ...
    Paddy Coleman Paddy Coleman May 2012 Sinclair Basic
  • General purpose full screen input routineHi Folks, One of the things that annoyed me back in the 1980s with most BASICs was the lack of a full screen "formatted" input function. You could …

    ... are using the DATADD and DEFADD system variables here. Can you ... define a FUNCtion like DEF FN A(p1,p2,p3)=usr ... the lines under the DEF FN were read as procedure that ... the procedure like a RANDOMIZE FN A(1,2,3)
    Dr BEEP Dr BEEP May 2012 Sinclair Basic
  • General purpose full screen input routineHi Folks, One of the things that annoyed me back in the 1980s with most BASICs was the lack of a full screen "formatted" input function. You could …

    ... are using the DATADD and DEFADD system variables here. Can you ... hidden variables space allocated to FN a(). Using the function will ... strings) in that space. Setting DEFADD to point to it enables ... the variables are global as DEFADD is only set once. To ...
    Battle Bunny Battle Bunny May 2012 Sinclair Basic
  • More memoryHi all... can anyone help, Is it possible to get more memory for basic pref' in Basin.... 40 odd k is just not enough !

    ... index parameters:
    REM f = FN x() variables address; d = ... 256*PEEK (a+1): DEF FN c()=FN p(23621)
    9899 ... /> POKE 23563,FN g(defa): POKE 23564,FN h(defa):
    REM restore VARS & reset DEFADD, retaining compacted DATA array & ...
    Battle Bunny Battle Bunny November 2012 Sinclair Basic
  • +3 BASIC DOS_DemoI got side-tracked while working on the Op.Wolf conversion and ended up writing this +3 DOS utility which provides most of the disk functions that mi…

    ... returns updated values for the FN (a) parameters to maintain ... had to reset DEFADD before returning and so the FN (a) parameters ... RESTORE FN c()+k1: POKE dh,k0: REM disable DEFADD redirection
    923 FOR h=kC-k3 TO kC: POKE FN ...
    Battle Bunny Battle Bunny January 2013 Sinclair Basic
  • Screens and BasicA question about the ZX screens. I am using software to convert my own art and drawings to the ZX Spectrum. I have some tools to change .jpg files in…

    ... br /> [code]
    2 DEF FN p(a)=PEEK a+256 ... a
    30 DEF FN a$(a$)=""
    REM ... /> REM 23563 = DEFADD = address of DEF FN parameters
    31 ... RESTORE 30: LET d=FN p(23639)+9:
    ... POKE 23563,FN l(d): POKE 23564,FN h(d): ...
    Battle Bunny Battle Bunny February 2013 Sinclair Basic
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere. [code] 2 DEF FN t$(n,t,d) =STR$ INT (n/t)…

    ... .
    [code]
    10 DEF FN p(a)=PEEK a+256 ... ):
    CLEAR 65367: LET UDG=FN p(23675): LET k0=NOT ...
    Battle Bunny Battle Bunny August 2013 Sinclair Basic
  • SE Basic IV Buffy v4.1 source (WIP)I've been doing a major refactor on the SE Basic source and I'd appreciate a code review from anyone who has time to look at it. I've almost certainl…

    [code]; THE SCANNING VARIABLE ROUTINE
    org 0x26c9
    s_letter:
    call look_vars ; check for matching entry
    jp c, report_2 ; error if not
    call z, stk_var ; stack parameters
    ld a, (flags) ; get flags
    cp ...
    chev chev October 2013 Development
  • IF EXIST?In MS-DOS scripting, there is an IF EXIST command that lets you check wether a file exists in disk or not. There are any way to check it out from BA…

    ... />
    [code]
    2 DEF FN o(f$)=USR 32768
    20 LET exists=FN o(f$+CHR$ 255)
    ld hl,(23563) ;(DEFADD) holds start of FN o(f$) arg
    Battle Bunny Battle Bunny October 2013 Sinclair Basic
<1234567…30>

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
fn 866 4.4K
defadd 102 200

Related Threads

  • DEF FN DirectivesI am looking at using some machine code functions from the DK Graphics Pack. They are machine code but they are called via Basic with the function de…
  • problem with DEFADD storageI have a function: DEF FN t(t$,m,t)=USR t<br /> which is called with, for an example: LET bc=FN t("t$()",mcworkspace,mcputt)<br /> where, at the time…
  • Can you improve this recursive DEF FN?I came up with this function to scan strings for characters without needing to use FOR...NEXT and IF...THEN, but it seems rather long-winded. Can any…
  • fn bug in basin?Hi.<br /> I was just trying to make myself some functions in basin and when i tryed them, the progam stopped on call.<br /> So i've tryed this simple…
  • FN nesting error?While playing with FN functions that call assembly, I've found something weird. <br /> <br /> Check out this code:<br /> [code]10 DEF FN f(a,b)=a+b<b…
  • BASin v.15 DEF FN bugThe bug would appear to be in "BASSupport.pas : Procedure ProcessDEFFN"; as it's not inserting the 6-byte variable place holder after each parameter …
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere.<br /> [code]<br /> 2 DEF FN t$(n,t,d)<br /> …
  • Fix for the DEF FN bug of zmakebasSome months ago I discovered a bug in zmakebas: it does not include the 5 bytes required after every parameter of a DEF FN.<br /> <br /> By the tim…
  • BASIC Bug: DEF FN after REMHello all,<br /> Having mused the Spectrum ROM disassembly by Drs Logan ad O'Hara, I wondered about how good ZX BASIC was at locating the DEF FN whe…

Related Searches

  • modulo function def fn
  • fuse def fn keyboard
  • def fn usr
  • def fn
  • def fn within a function
  • fn h
  • upper case fn
  • def fn d
  • recursive fn
  • bin def fn
  • def fn recursive bug
  • def fn bug
  • defadd
  • def fn recursive bin
  • fn usr
  • def fn library
  • def fn v
  • def fn gosub fast
  • def fn battlebunny
  • def fn fast

Copyright © 2024 World of Spectrum